Priviliged users can now add tags. Also, some minor cleanups in JS.
authorŁukasz Rekucki <lrekucki@gmail.com>
Mon, 12 Apr 2010 13:34:02 +0000 (15:34 +0200)
committerŁukasz Rekucki <lrekucki@gmail.com>
Mon, 12 Apr 2010 13:40:06 +0000 (15:40 +0200)
78 files changed:
apps/filebrowser/media/filebrowser/js/AddFileBrowser.js
apps/filebrowser/media/filebrowser/js/FB_FileBrowseField.js
apps/filebrowser/media/filebrowser/js/FB_TinyMCE.js
apps/filebrowser/media/filebrowser/js/TinyMCEAdmin.js
apps/filebrowser/media/filebrowser/uploadify/example/scripts/jquery.uploadify.v2.1.0.min.js
apps/filebrowser/media/filebrowser/uploadify/example/scripts/swfobject.js
apps/filebrowser/media/filebrowser/uploadify/jquery.uploadify.v2.1.0.js
apps/filebrowser/media/filebrowser/uploadify/jquery.uploadify.v2.1.0.min.js
apps/filebrowser/media/filebrowser/uploadify/swfobject.js
apps/filebrowser/templates/filebrowser/include/filelisting.html
apps/filebrowser/templates/filebrowser/include/tableheader.html
apps/filebrowser/templates/filebrowser/makedir.html
apps/filebrowser/templates/filebrowser/rename.html
apps/filebrowser/templates/filebrowser/upload.html
apps/filebrowser/templates/filebrowser/versions.html
apps/toolbar/templates/toolbar/button.html
apps/toolbar/templates/toolbar/toolbar.html
apps/wiki/constants.py [new file with mode: 0644]
apps/wiki/forms.py
apps/wiki/helpers.py
apps/wiki/models.py
apps/wiki/nice_diff.py
apps/wiki/templates/wiki/document_details.html
apps/wiki/templates/wiki/document_list.html
apps/wiki/templates/wiki/history_view.html
apps/wiki/templates/wiki/save_dialog.html
apps/wiki/templates/wiki/summary_view.html
apps/wiki/templates/wiki/tag_dialog.html
apps/wiki/urls.py
apps/wiki/views.py
lib/vstorage.py
platforma/context_processors.py
platforma/settings.py
platforma/static/css/dialogs.css
platforma/static/css/master.css
platforma/static/filebrowser/js/AddFileBrowser.js
platforma/static/filebrowser/js/FB_FileBrowseField.js
platforma/static/filebrowser/js/FB_TinyMCE.js
platforma/static/filebrowser/js/TinyMCEAdmin.js
platforma/static/filebrowser/uploadify/example/scripts/jquery.uploadify.v2.1.0.min.js
platforma/static/filebrowser/uploadify/example/scripts/swfobject.js
platforma/static/filebrowser/uploadify/jquery.uploadify.v2.1.0.js
platforma/static/filebrowser/uploadify/jquery.uploadify.v2.1.0.min.js
platforma/static/filebrowser/uploadify/swfobject.js
platforma/static/icons/close.png
platforma/static/js/button_scripts.js
platforma/static/js/jquery.autocomplete.js
platforma/static/js/jquery.blockui.js
platforma/static/js/lib/codemirror/editor.js
platforma/static/js/lib/codemirror/parsexml.js
platforma/static/js/lib/codemirror/tokenize.js
platforma/static/js/slugify.js
platforma/static/js/wiki/base.js
platforma/static/js/wiki/dialog_addtag.js [new file with mode: 0644]
platforma/static/js/wiki/dialog_save.js [new file with mode: 0644]
platforma/static/js/wiki/diff_view.js [deleted file]
platforma/static/js/wiki/history_view.js [deleted file]
platforma/static/js/wiki/loader.js [new file with mode: 0644]
platforma/static/js/wiki/main.js [deleted file]
platforma/static/js/wiki/save_dialog.js [deleted file]
platforma/static/js/wiki/scan_gallery.js [deleted file]
platforma/static/js/wiki/source_editor.js [deleted file]
platforma/static/js/wiki/summary_view.js [deleted file]
platforma/static/js/wiki/view_column_diff.js [new file with mode: 0644]
platforma/static/js/wiki/view_editor_source.js [new file with mode: 0644]
platforma/static/js/wiki/view_editor_wysiwyg.js [new file with mode: 0644]
platforma/static/js/wiki/view_gallery.js [new file with mode: 0644]
platforma/static/js/wiki/view_history.js [new file with mode: 0644]
platforma/static/js/wiki/view_summary.js [new file with mode: 0644]
platforma/static/js/wiki/wikiapi.js
platforma/static/js/wiki/wysiwyg_editor.js [deleted file]
platforma/static/js/wiki/xslt.js
platforma/templates/404.html
platforma/templates/500.html
platforma/templates/503.html
platforma/templates/admin/index.html
platforma/templates/registration/head_login.html
platforma/urls.py

index 3a99442..888885f 100644 (file)
@@ -4,7 +4,7 @@ var FileBrowser = {
     // change this
     thumb_prefix: 'thumb_',
     no_thumb: 'filebrowser/img/no_thumb.gif',
-    
+
     init: function() {
         // Deduce admin_media_prefix by looking at the <script>s in the
         // current document and finding the URL of *this* module.
index b0696ce..5e3aa9f 100644 (file)
@@ -1,5 +1,5 @@
 function FileSubmit(FileURL, ThumbURL, FileType) {
-    
+
     // var input_id=window.name.split("___").join(".");
     var input_id=window.name.replace(/____/g,'-').split("___").join(".");
     var preview_id = 'image_' + input_id;
@@ -11,7 +11,7 @@ function FileSubmit(FileURL, ThumbURL, FileType) {
     help = opener.document.getElementById(help_id);
     // set new value for input field
     input.value = FileURL;
-    
+
     if (ThumbURL && FileType != "") {
         // selected file is an image and thumbnail is available:
         // display the preview-image (thumbnail)
index 86d6939..b2d4d60 100644 (file)
@@ -7,10 +7,10 @@ var FileBrowserDialogue = {
     fileSubmit : function (FileURL) {
         var URL = FileURL;
         var win = tinyMCEPopup.getWindowArg("window");
-        
+
         // insert information now
         win.document.getElementById(tinyMCEPopup.getWindowArg("input")).value = URL;
-        
+
         // change width/height & show preview
         if (win.ImageDialog){
             if (win.ImageDialog.getImageData)
@@ -18,7 +18,7 @@ var FileBrowserDialogue = {
             if (win.ImageDialog.showPreviewImage)
                 win.ImageDialog.showPreviewImage(URL);
         }
-        
+
         // close popup window
         tinyMCEPopup.close();
     }
index 760a666..902fc9f 100644 (file)
@@ -2,7 +2,7 @@ function CustomFileBrowser(field_name, url, type, win) {
 
     var cmsURL = "/admin/filebrowser/browse/?pop=2";
     cmsURL = cmsURL + "&type=" + type;
-    
+
     tinyMCE.activeEditor.windowManager.open({
         file: cmsURL,
         width: 820,  // Your dimensions may differ - toy around with them!
@@ -48,27 +48,27 @@ tinyMCE.init({
     file_browser_callback: "CustomFileBrowser",
     relative_urls: false,
     valid_elements : "" +
-    "-p," + 
+    "-p," +
     "a[href|target=_blank|class]," +
     "-strong/-b," +
     "-em/-i," +
-    "-u," + 
-    "-ol," + 
-    "-ul," + 
-    "-li," + 
-    "br," + 
-    "img[class|src|alt=|width|height]," + 
-    "-h2,-h3,-h4," + 
+    "-u," +
+    "-ol," +
+    "-ul," +
+    "-li," +
+    "br," +
+    "img[class|src|alt=|width|height]," +
+    "-h2,-h3,-h4," +
     "-pre," +
-    "-code," + 
+    "-code," +
     "-div",
-    extended_valid_elements: "" + 
-    "a[name|class|href|target|title|onclick]," + 
-    "img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]," + 
-    "br[clearfix]," + 
-    "-p[class<clearfix?summary?code]," + 
-    "h2[class<clearfix],h3[class<clearfix],h4[class<clearfix]," + 
-    "ul[class<clearfix],ol[class<clearfix]," + 
+    extended_valid_elements: "" +
+    "a[name|class|href|target|title|onclick]," +
+    "img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]," +
+    "br[clearfix]," +
+    "-p[class<clearfix?summary?code]," +
+    "h2[class<clearfix],h3[class<clearfix],h4[class<clearfix]," +
+    "ul[class<clearfix],ol[class<clearfix]," +
     "div[class],"
 });
 
index 04592ff..4305311 100644 (file)
@@ -1,26 +1,26 @@
-/*\r
-Uploadify v2.1.0\r
-Release Date: August 24, 2009\r
-\r
-Copyright (c) 2009 Ronnie Garcia, Travis Nickels\r
-\r
-Permission is hereby granted, free of charge, to any person obtaining a copy\r
-of this software and associated documentation files (the "Software"), to deal\r
-in the Software without restriction, including without limitation the rights\r
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
-copies of the Software, and to permit persons to whom the Software is\r
-furnished to do so, subject to the following conditions:\r
-\r
-The above copyright notice and this permission notice shall be included in\r
-all copies or substantial portions of the Software.\r
-\r
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
-THE SOFTWARE.\r
-*/\r
-\r
+/*
+Uploadify v2.1.0
+Release Date: August 24, 2009
+
+Copyright (c) 2009 Ronnie Garcia, Travis Nickels
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
 if(jQuery){(function(a){a.extend(a.fn,{uploadify:function(b){a(this).each(function(){settings=a.extend({id:a(this).attr("id"),uploader:"uploadify.swf",script:"uploadify.php",expressInstall:null,folder:"",height:30,width:110,cancelImg:"cancel.png",wmode:"opaque",scriptAccess:"sameDomain",fileDataName:"Filedata",method:"POST",queueSizeLimit:999,simUploadLimit:1,queueID:false,displayData:"percentage",onInit:function(){},onSelect:function(){},onQueueFull:function(){},onCheck:function(){},onCancel:function(){},onError:function(){},onProgress:function(){},onComplete:function(){},onAllComplete:function(){}},b);var e=location.pathname;e=e.split("/");e.pop();e=e.join("/")+"/";var f={};f.uploadifyID=settings.id;f.pagepath=e;if(settings.buttonImg){f.buttonImg=escape(settings.buttonImg)}if(settings.buttonText){f.buttonText=escape(settings.buttonText)}if(settings.rollover){f.rollover=true}f.script=settings.script;f.folder=escape(settings.folder);if(settings.scriptData){var g="";for(var d in settings.scriptData){g+="&"+d+"="+settings.scriptData[d]}f.scriptData=escape(g.substr(1))}f.width=settings.width;f.height=settings.height;f.wmode=settings.wmode;f.method=settings.method;f.queueSizeLimit=settings.queueSizeLimit;f.simUploadLimit=settings.simUploadLimit;if(settings.hideButton){f.hideButton=true}if(settings.fileDesc){f.fileDesc=settings.fileDesc}if(settings.fileExt){f.fileExt=settings.fileExt}if(settings.multi){f.multi=true}if(settings.auto){f.auto=true}if(settings.sizeLimit){f.sizeLimit=settings.sizeLimit}if(settings.checkScript){f.checkScript=settings.checkScript}if(settings.fileDataName){f.fileDataName=settings.fileDataName}if(settings.queueID){f.queueID=settings.queueID}if(settings.onInit()!==false){a(this).css("display","none");a(this).after('<div id="'+a(this).attr("id")+'Uploader"></div>');swfobject.embedSWF(settings.uploader,settings.id+"Uploader",settings.width,settings.height,"9.0.24",settings.expressInstall,f,{quality:"high",wmode:settings.wmode,allowScriptAccess:settings.scriptAccess});if(settings.queueID==false){a("#"+a(this).attr("id")+"Uploader").after('<div id="'+a(this).attr("id")+'Queue" class="uploadifyQueue"></div>')}}if(typeof(settings.onOpen)=="function"){a(this).bind("uploadifyOpen",settings.onOpen)}a(this).bind("uploadifySelect",{action:settings.onSelect,queueID:settings.queueID},function(j,h,i){if(j.data.action(j,h,i)!==false){var k=Math.round(i.size/1024*100)*0.01;var l="KB";if(k>1000){k=Math.round(k*0.001*100)*0.01;l="MB"}var m=k.toString().split(".");if(m.length>1){k=m[0]+"."+m[1].substr(0,2)}else{k=m[0]}if(i.name.length>20){fileName=i.name.substr(0,20)+"..."}else{fileName=i.name}queue="#"+a(this).attr("id")+"Queue";if(j.data.queueID){queue="#"+j.data.queueID}a(queue).append('<div id="'+a(this).attr("id")+h+'" class="uploadifyQueueItem"><div class="cancel"><a href="javascript:jQuery(\'#'+a(this).attr("id")+"').uploadifyCancel('"+h+'\')"><img src="'+settings.cancelImg+'" border="0" /></a></div><span class="fileName">'+fileName+" ("+k+l+')</span><span class="percentage"></span><div class="uploadifyProgress"><div id="'+a(this).attr("id")+h+'ProgressBar" class="uploadifyProgressBar"><!--Progress Bar--></div></div></div>')}});if(typeof(settings.onSelectOnce)=="function"){a(this).bind("uploadifySelectOnce",settings.onSelectOnce)}a(this).bind("uploadifyQueueFull",{action:settings.onQueueFull},function(h,i){if(h.data.action(h,i)!==false){alert("The queue is full.  The max size is "+i+".")}});a(this).bind("uploadifyCheckExist",{action:settings.onCheck},function(m,l,k,j,o){var i=new Object();i=k;i.folder=e+j;if(o){for(var h in k){var n=h}}a.post(l,i,function(r){for(var p in r){if(m.data.action(m,l,k,j,o)!==false){var q=confirm("Do you want to replace the file "+r[p]+"?");if(!q){document.getElementById(a(m.target).attr("id")+"Uploader").cancelFileUpload(p,true,true)}}}if(o){document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(n,true)}else{document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(null,true)}},"json")});a(this).bind("uploadifyCancel",{action:settings.onCancel},function(l,h,k,m,j){if(l.data.action(l,h,k,m,j)!==false){var i=(j==true)?0:250;a("#"+a(this).attr("id")+h).fadeOut(i,function(){a(this).remove()})}});if(typeof(settings.onClearQueue)=="function"){a(this).bind("uploadifyClearQueue",settings.onClearQueue)}var c=[];a(this).bind("uploadifyError",{action:settings.onError},function(l,h,k,j){if(l.data.action(l,h,k,j)!==false){var i=new Array(h,k,j);c.push(i);a("#"+a(this).attr("id")+h+" .percentage").text(" - "+j.type+" Error");a("#"+a(this).attr("id")+h).addClass("uploadifyError")}});a(this).bind("uploadifyProgress",{action:settings.onProgress,toDisplay:settings.displayData},function(j,h,i,k){if(j.data.action(j,h,i,k)!==false){a("#"+a(this).attr("id")+h+"ProgressBar").css("width",k.percentage+"%");if(j.data.toDisplay=="percentage"){displayData=" - "+k.percentage+"%"}if(j.data.toDisplay=="speed"){displayData=" - "+k.speed+"KB/s"}if(j.data.toDisplay==null){displayData=" "}a("#"+a(this).attr("id")+h+" .percentage").text(displayData)}});a(this).bind("uploadifyComplete",{action:settings.onComplete},function(k,h,j,i,l){if(k.data.action(k,h,j,unescape(i),l)!==false){a("#"+a(this).attr("id")+h+" .percentage").text(" - Completed");a("#"+a(this).attr("id")+h).fadeOut(250,function(){a(this).remove()})}});if(typeof(settings.onAllComplete)=="function"){a(this).bind("uploadifyAllComplete",{action:settings.onAllComplete},function(h,i){if(h.data.action(h,i)!==false){c=[]}})}})},uploadifySettings:function(f,j,c){var g=false;a(this).each(function(){if(f=="scriptData"&&j!=null){if(c){var i=j}else{var i=a.extend(settings.scriptData,j)}var l="";for(var k in i){l+="&"+k+"="+escape(i[k])}j=l.substr(1)}g=document.getElementById(a(this).attr("id")+"Uploader").updateSettings(f,j)});if(j==null){if(f=="scriptData"){var b=unescape(g).split("&");var e=new Object();for(var d=0;d<b.length;d++){var h=b[d].split("=");e[h[0]]=h[1]}g=e}return g}},uploadifyUpload:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").startFileUpload(b,false)})},uploadifyCancel:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").cancelFileUpload(b,true,false)})},uploadifyClearQueue:function(){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").clearFileUploadQueue(false)})}})})(jQuery)};
\ No newline at end of file
index 8eafe9d..acc7da4 100644 (file)
@@ -1,4 +1,4 @@
-/*     SWFObject v2.2 <http://code.google.com/p/swfobject/> 
-       is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
+/*     SWFObject v2.2 <http://code.google.com/p/swfobject/>
+       is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
 */
 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}}}}();
\ No newline at end of file
index 9a78cd3..43c87be 100644 (file)
-/*\r
-Uploadify v2.1.0\r
-Release Date: August 24, 2009\r
-\r
-Copyright (c) 2009 Ronnie Garcia, Travis Nickels\r
-\r
-Permission is hereby granted, free of charge, to any person obtaining a copy\r
-of this software and associated documentation files (the "Software"), to deal\r
-in the Software without restriction, including without limitation the rights\r
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
-copies of the Software, and to permit persons to whom the Software is\r
-furnished to do so, subject to the following conditions:\r
-\r
-The above copyright notice and this permission notice shall be included in\r
-all copies or substantial portions of the Software.\r
-\r
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
-THE SOFTWARE.\r
-*/\r
-\r
-if(jQuery)(\r
-       function(jQuery){\r
-               jQuery.extend(jQuery.fn,{\r
-                       uploadify:function(options) {\r
-                               jQuery(this).each(function(){\r
-                                       settings = jQuery.extend({\r
-                                       id             : jQuery(this).attr('id'), // The ID of the object being Uploadified\r
-                                       uploader       : 'uploadify.swf', // The path to the uploadify swf file\r
-                                       script         : 'uploadify.php', // The path to the uploadify backend upload script\r
-                                       expressInstall : null, // The path to the express install swf file\r
-                                       folder         : '', // The path to the upload folder\r
-                                       height         : 30, // The height of the flash button\r
-                                       width          : 110, // The width of the flash button\r
-                                       cancelImg      : 'cancel.png', // The path to the cancel image for the default file queue item container\r
-                                       wmode          : 'opaque', // The wmode of the flash file\r
-                                       scriptAccess   : 'sameDomain', // Set to "always" to allow script access across domains\r
-                                       fileDataName   : 'Filedata', // The name of the file collection object in the backend upload script\r
-                                       method         : 'POST', // The method for sending variables to the backend upload script\r
-                                       queueSizeLimit : 999, // The maximum size of the file queue\r
-                                       simUploadLimit : 1, // The number of simultaneous uploads allowed\r
-                                       queueID        : false, // The optional ID of the queue container\r
-                                       displayData    : 'percentage', // Set to "speed" to show the upload speed in the default queue item\r
-                                       onInit         : function() {}, // Function to run when uploadify is initialized\r
-                                       onSelect       : function() {}, // Function to run when a file is selected\r
-                                       onQueueFull    : function() {}, // Function to run when the queue reaches capacity\r
-                                       onCheck        : function() {}, // Function to run when script checks for duplicate files on the server\r
-                                       onCancel       : function() {}, // Function to run when an item is cleared from the queue\r
-                                       onError        : function() {}, // Function to run when an upload item returns an error\r
-                                       onProgress     : function() {}, // Function to run each time the upload progress is updated\r
-                                       onComplete     : function() {}, // Function to run when an upload is completed\r
-                                       onAllComplete  : function() {}  // Functino to run when all uploads are completed\r
-                               }, options);\r
-                               var pagePath = location.pathname;\r
-                               pagePath = pagePath.split('/');\r
-                               pagePath.pop();\r
-                               pagePath = pagePath.join('/') + '/';\r
-                               var data = {};\r
-                               data.uploadifyID = settings.id;\r
-                               data.pagepath = pagePath;\r
-                               if (settings.buttonImg) data.buttonImg = escape(settings.buttonImg);\r
-                               if (settings.buttonText) data.buttonText = escape(settings.buttonText);\r
-                               if (settings.rollover) data.rollover = true;\r
-                               data.script = settings.script;\r
-                               data.folder = escape(settings.folder);\r
-                               if (settings.scriptData) {\r
-                                       var scriptDataString = '';\r
-                                       for (var name in settings.scriptData) {\r
-                                               scriptDataString += '&' + name + '=' + settings.scriptData[name];\r
-                                       }\r
-                                       data.scriptData = escape(scriptDataString.substr(1));\r
-                               }\r
-                               data.width          = settings.width;\r
-                               data.height         = settings.height;\r
-                               data.wmode          = settings.wmode;\r
-                               data.method         = settings.method;\r
-                               data.queueSizeLimit = settings.queueSizeLimit;\r
-                               data.simUploadLimit = settings.simUploadLimit;\r
-                               if (settings.hideButton)   data.hideButton   = true;\r
-                               if (settings.fileDesc)     data.fileDesc     = settings.fileDesc;\r
-                               if (settings.fileExt)      data.fileExt      = settings.fileExt;\r
-                               if (settings.multi)        data.multi        = true;\r
-                               if (settings.auto)         data.auto         = true;\r
-                               if (settings.sizeLimit)    data.sizeLimit    = settings.sizeLimit;\r
-                               if (settings.checkScript)  data.checkScript  = settings.checkScript;\r
-                               if (settings.fileDataName) data.fileDataName = settings.fileDataName;\r
-                               if (settings.queueID)      data.queueID      = settings.queueID;\r
-                               if (settings.onInit() !== false) {\r
-                                       jQuery(this).css('display','none');\r
-                                       jQuery(this).after('<div id="' + jQuery(this).attr('id') + 'Uploader"></div>');\r
-                                       swfobject.embedSWF(settings.uploader, settings.id + 'Uploader', settings.width, settings.height, '9.0.24', settings.expressInstall, data, {'quality':'high','wmode':settings.wmode,'allowScriptAccess':settings.scriptAccess});\r
-                                       if (settings.queueID == false) {\r
-                                               jQuery("#" + jQuery(this).attr('id') + "Uploader").after('<div id="' + jQuery(this).attr('id') + 'Queue" class="uploadifyQueue"></div>');\r
-                                       }\r
-                               }\r
-                               if (typeof(settings.onOpen) == 'function') {\r
-                                       jQuery(this).bind("uploadifyOpen", settings.onOpen);\r
-                               }\r
-                               jQuery(this).bind("uploadifySelect", {'action': settings.onSelect, 'queueID': settings.queueID}, function(event, ID, fileObj) {\r
-                                       if (event.data.action(event, ID, fileObj) !== false) {\r
-                                               var byteSize = Math.round(fileObj.size / 1024 * 100) * .01;\r
-                                               var suffix = 'KB';\r
-                                               if (byteSize > 1000) {\r
-                                                       byteSize = Math.round(byteSize *.001 * 100) * .01;\r
-                                                       suffix = 'MB';\r
-                                               }\r
-                                               var sizeParts = byteSize.toString().split('.');\r
-                                               if (sizeParts.length > 1) {\r
-                                                       byteSize = sizeParts[0] + '.' + sizeParts[1].substr(0,2);\r
-                                               } else {\r
-                                                       byteSize = sizeParts[0];\r
-                                               }\r
-                                               if (fileObj.name.length > 20) {\r
-                                                       fileName = fileObj.name.substr(0,20) + '...';\r
-                                               } else {\r
-                                                       fileName = fileObj.name;\r
-                                               }\r
-                                               queue = '#' + jQuery(this).attr('id') + 'Queue';\r
-                                               if (event.data.queueID) {\r
-                                                       queue = '#' + event.data.queueID;\r
-                                               }\r
-                                               jQuery(queue).append('<div id="' + jQuery(this).attr('id') + ID + '" class="uploadifyQueueItem">\\r
-                                                               <div class="cancel">\\r
-                                                                       <a href="javascript:jQuery(\'#' + jQuery(this).attr('id') + '\').uploadifyCancel(\'' + ID + '\')"><img src="' + settings.cancelImg + '" border="0" /></a>\\r
-                                                               </div>\\r
-                                                               <span class="fileName">' + fileName + ' (' + byteSize + suffix + ')</span><span class="percentage"></span>\\r
-                                                               <div class="uploadifyProgress">\\r
-                                                                       <div id="' + jQuery(this).attr('id') + ID + 'ProgressBar" class="uploadifyProgressBar"><!--Progress Bar--></div>\\r
-                                                               </div>\\r
-                                                       </div>');\r
-                                       }\r
-                               });\r
-                               if (typeof(settings.onSelectOnce) == 'function') {\r
-                                       jQuery(this).bind("uploadifySelectOnce", settings.onSelectOnce);\r
-                               }\r
-                               jQuery(this).bind("uploadifyQueueFull", {'action': settings.onQueueFull}, function(event, queueSizeLimit) {\r
-                                       if (event.data.action(event, queueSizeLimit) !== false) {\r
-                                               alert('The queue is full.  The max size is ' + queueSizeLimit + '.');\r
-                                       }\r
-                               });\r
-                               jQuery(this).bind("uploadifyCheckExist", {'action': settings.onCheck}, function(event, checkScript, fileQueueObj, folder, single) {\r
-                                       var postData = new Object();\r
-                                       postData = fileQueueObj;\r
-                                       postData.folder = pagePath + folder;\r
-                                       if (single) {\r
-                                               for (var ID in fileQueueObj) {\r
-                                                       var singleFileID = ID;\r
-                                               }\r
-                                       }\r
-                                       jQuery.post(checkScript, postData, function(data) {\r
-                                               for(var key in data) {\r
-                                                       if (event.data.action(event, checkScript, fileQueueObj, folder, single) !== false) {\r
-                                                               var replaceFile = confirm("Do you want to replace the file " + data[key] + "?");\r
-                                                               if (!replaceFile) {\r
-                                                                       document.getElementById(jQuery(event.target).attr('id') + 'Uploader').cancelFileUpload(key, true,true);\r
-                                                               }\r
-                                                       }\r
-                                               }\r
-                                               if (single) {\r
-                                                       document.getElementById(jQuery(event.target).attr('id') + 'Uploader').startFileUpload(singleFileID, true);\r
-                                               } else {\r
-                                                       document.getElementById(jQuery(event.target).attr('id') + 'Uploader').startFileUpload(null, true);\r
-                                               }\r
-                                       }, "json");\r
-                               });\r
-                               jQuery(this).bind("uploadifyCancel", {'action': settings.onCancel}, function(event, ID, fileObj, data, clearFast) {\r
-                                       if (event.data.action(event, ID, fileObj, data, clearFast) !== false) {\r
-                                               var fadeSpeed = (clearFast == true) ? 0 : 250;\r
-                                               jQuery("#" + jQuery(this).attr('id') + ID).fadeOut(fadeSpeed, function() { jQuery(this).remove() });\r
-                                       }\r
-                               });\r
-                               if (typeof(settings.onClearQueue) == 'function') {\r
-                                       jQuery(this).bind("uploadifyClearQueue", settings.onClearQueue);\r
-                               }\r
-                               var errorArray = [];\r
-                               jQuery(this).bind("uploadifyError", {'action': settings.onError}, function(event, ID, fileObj, errorObj) {\r
-                                       if (event.data.action(event, ID, fileObj, errorObj) !== false) {\r
-                                               var fileArray = new Array(ID, fileObj, errorObj);\r
-                                               errorArray.push(fileArray);\r
-                                               jQuery("#" + jQuery(this).attr('id') + ID + " .percentage").text(" - " + errorObj.type + " Error");\r
-                                               jQuery("#" + jQuery(this).attr('id') + ID).addClass('uploadifyError');\r
-                                       }\r
-                               });\r
-                               jQuery(this).bind("uploadifyProgress", {'action': settings.onProgress, 'toDisplay': settings.displayData}, function(event, ID, fileObj, data) {\r
-                                       if (event.data.action(event, ID, fileObj, data) !== false) {\r
-                                               jQuery("#" + jQuery(this).attr('id') + ID + "ProgressBar").css('width', data.percentage + '%');\r
-                                               if (event.data.toDisplay == 'percentage') displayData = ' - ' + data.percentage + '%';\r
-                                               if (event.data.toDisplay == 'speed') displayData = ' - ' + data.speed + 'KB/s';\r
-                                               if (event.data.toDisplay == null) displayData = ' ';\r
-                                               jQuery("#" + jQuery(this).attr('id') + ID + " .percentage").text(displayData);\r
-                                       }\r
-                               });\r
-                               jQuery(this).bind("uploadifyComplete", {'action': settings.onComplete}, function(event, ID, fileObj, response, data) {\r
-                                       if (event.data.action(event, ID, fileObj, unescape(response), data) !== false) {\r
-                                               jQuery("#" + jQuery(this).attr('id') + ID + " .percentage").text(' - Completed');\r
-                                               jQuery("#" + jQuery(this).attr('id') + ID).fadeOut(250, function() { jQuery(this).remove()});\r
-                                       }\r
-                               });\r
-                               if (typeof(settings.onAllComplete) == 'function') {\r
-                                       jQuery(this).bind("uploadifyAllComplete", {'action': settings.onAllComplete}, function(event, uploadObj) {\r
-                                               if (event.data.action(event, uploadObj) !== false) {\r
-                                                       errorArray = [];\r
-                                               }\r
-                                       });\r
-                               }\r
-                       });\r
-               },\r
-               uploadifySettings:function(settingName, settingValue, resetObject) {\r
-                       var returnValue = false;\r
-                       jQuery(this).each(function() {\r
-                               if (settingName == 'scriptData' && settingValue != null) {\r
-                                       if (resetObject) {\r
-                                               var scriptData = settingValue;\r
-                                       } else {\r
-                                               var scriptData = jQuery.extend(settings.scriptData, settingValue);\r
-                                       }\r
-                                       var scriptDataString = '';\r
-                                       for (var name in scriptData) {\r
-                                               scriptDataString += '&' + name + '=' + escape(scriptData[name]);\r
-                                       }\r
-                                       settingValue = scriptDataString.substr(1);\r
-                               }\r
-                               returnValue = document.getElementById(jQuery(this).attr('id') + 'Uploader').updateSettings(settingName, settingValue);\r
-                       });\r
-                       if (settingValue == null) {\r
-                               if (settingName == 'scriptData') {\r
-                                       var returnSplit = unescape(returnValue).split('&');\r
-                                       var returnObj   = new Object();\r
-                                       for (var i = 0; i < returnSplit.length; i++) {\r
-                                               var iSplit = returnSplit[i].split('=');\r
-                                               returnObj[iSplit[0]] = iSplit[1];\r
-                                       }\r
-                                       returnValue = returnObj;\r
-                               }\r
-                               return returnValue;\r
-                       }\r
-               },\r
-               uploadifyUpload:function(ID) {\r
-                       jQuery(this).each(function() {\r
-                               document.getElementById(jQuery(this).attr('id') + 'Uploader').startFileUpload(ID, false);\r
-                       });\r
-               },\r
-               uploadifyCancel:function(ID) {\r
-                       jQuery(this).each(function() {\r
-                               document.getElementById(jQuery(this).attr('id') + 'Uploader').cancelFileUpload(ID, true, false);\r
-                       });\r
-               },\r
-               uploadifyClearQueue:function() {\r
-                       jQuery(this).each(function() {\r
-                               document.getElementById(jQuery(this).attr('id') + 'Uploader').clearFileUploadQueue(false);\r
-                       });\r
-               }\r
-       })\r
+/*
+Uploadify v2.1.0
+Release Date: August 24, 2009
+
+Copyright (c) 2009 Ronnie Garcia, Travis Nickels
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
+if(jQuery)(
+       function(jQuery){
+               jQuery.extend(jQuery.fn,{
+                       uploadify:function(options) {
+                               jQuery(this).each(function(){
+                                       settings = jQuery.extend({
+                                       id             : jQuery(this).attr('id'), // The ID of the object being Uploadified
+                                       uploader       : 'uploadify.swf', // The path to the uploadify swf file
+                                       script         : 'uploadify.php', // The path to the uploadify backend upload script
+                                       expressInstall : null, // The path to the express install swf file
+                                       folder         : '', // The path to the upload folder
+                                       height         : 30, // The height of the flash button
+                                       width          : 110, // The width of the flash button
+                                       cancelImg      : 'cancel.png', // The path to the cancel image for the default file queue item container
+                                       wmode          : 'opaque', // The wmode of the flash file
+                                       scriptAccess   : 'sameDomain', // Set to "always" to allow script access across domains
+                                       fileDataName   : 'Filedata', // The name of the file collection object in the backend upload script
+                                       method         : 'POST', // The method for sending variables to the backend upload script
+                                       queueSizeLimit : 999, // The maximum size of the file queue
+                                       simUploadLimit : 1, // The number of simultaneous uploads allowed
+                                       queueID        : false, // The optional ID of the queue container
+                                       displayData    : 'percentage', // Set to "speed" to show the upload speed in the default queue item
+                                       onInit         : function() {}, // Function to run when uploadify is initialized
+                                       onSelect       : function() {}, // Function to run when a file is selected
+                                       onQueueFull    : function() {}, // Function to run when the queue reaches capacity
+                                       onCheck        : function() {}, // Function to run when script checks for duplicate files on the server
+                                       onCancel       : function() {}, // Function to run when an item is cleared from the queue
+                                       onError        : function() {}, // Function to run when an upload item returns an error
+                                       onProgress     : function() {}, // Function to run each time the upload progress is updated
+                                       onComplete     : function() {}, // Function to run when an upload is completed
+                                       onAllComplete  : function() {}  // Functino to run when all uploads are completed
+                               }, options);
+                               var pagePath = location.pathname;
+                               pagePath = pagePath.split('/');
+                               pagePath.pop();
+                               pagePath = pagePath.join('/') + '/';
+                               var data = {};
+                               data.uploadifyID = settings.id;
+                               data.pagepath = pagePath;
+                               if (settings.buttonImg) data.buttonImg = escape(settings.buttonImg);
+                               if (settings.buttonText) data.buttonText = escape(settings.buttonText);
+                               if (settings.rollover) data.rollover = true;
+                               data.script = settings.script;
+                               data.folder = escape(settings.folder);
+                               if (settings.scriptData) {
+                                       var scriptDataString = '';
+                                       for (var name in settings.scriptData) {
+                                               scriptDataString += '&' + name + '=' + settings.scriptData[name];
+                                       }
+                                       data.scriptData = escape(scriptDataString.substr(1));
+                               }
+                               data.width          = settings.width;
+                               data.height         = settings.height;
+                               data.wmode          = settings.wmode;
+                               data.method         = settings.method;
+                               data.queueSizeLimit = settings.queueSizeLimit;
+                               data.simUploadLimit = settings.simUploadLimit;
+                               if (settings.hideButton)   data.hideButton   = true;
+                               if (settings.fileDesc)     data.fileDesc     = settings.fileDesc;
+                               if (settings.fileExt)      data.fileExt      = settings.fileExt;
+                               if (settings.multi)        data.multi        = true;
+                               if (settings.auto)         data.auto         = true;
+                               if (settings.sizeLimit)    data.sizeLimit    = settings.sizeLimit;
+                               if (settings.checkScript)  data.checkScript  = settings.checkScript;
+                               if (settings.fileDataName) data.fileDataName = settings.fileDataName;
+                               if (settings.queueID)      data.queueID      = settings.queueID;
+                               if (settings.onInit() !== false) {
+                                       jQuery(this).css('display','none');
+                                       jQuery(this).after('<div id="' + jQuery(this).attr('id') + 'Uploader"></div>');
+                                       swfobject.embedSWF(settings.uploader, settings.id + 'Uploader', settings.width, settings.height, '9.0.24', settings.expressInstall, data, {'quality':'high','wmode':settings.wmode,'allowScriptAccess':settings.scriptAccess});
+                                       if (settings.queueID == false) {
+                                               jQuery("#" + jQuery(this).attr('id') + "Uploader").after('<div id="' + jQuery(this).attr('id') + 'Queue" class="uploadifyQueue"></div>');
+                                       }
+                               }
+                               if (typeof(settings.onOpen) == 'function') {
+                                       jQuery(this).bind("uploadifyOpen", settings.onOpen);
+                               }
+                               jQuery(this).bind("uploadifySelect", {'action': settings.onSelect, 'queueID': settings.queueID}, function(event, ID, fileObj) {
+                                       if (event.data.action(event, ID, fileObj) !== false) {
+                                               var byteSize = Math.round(fileObj.size / 1024 * 100) * .01;
+                                               var suffix = 'KB';
+                                               if (byteSize > 1000) {
+                                                       byteSize = Math.round(byteSize *.001 * 100) * .01;
+                                                       suffix = 'MB';
+                                               }
+                                               var sizeParts = byteSize.toString().split('.');
+                                               if (sizeParts.length > 1) {
+                                                       byteSize = sizeParts[0] + '.' + sizeParts[1].substr(0,2);
+                                               } else {
+                                                       byteSize = sizeParts[0];
+                                               }
+                                               if (fileObj.name.length > 20) {
+                                                       fileName = fileObj.name.substr(0,20) + '...';
+                                               } else {
+                                                       fileName = fileObj.name;
+                                               }
+                                               queue = '#' + jQuery(this).attr('id') + 'Queue';
+                                               if (event.data.queueID) {
+                                                       queue = '#' + event.data.queueID;
+                                               }
+                                               jQuery(queue).append('<div id="' + jQuery(this).attr('id') + ID + '" class="uploadifyQueueItem">\
+                                                               <div class="cancel">\
+                                                                       <a href="javascript:jQuery(\'#' + jQuery(this).attr('id') + '\').uploadifyCancel(\'' + ID + '\')"><img src="' + settings.cancelImg + '" border="0" /></a>\
+                                                               </div>\
+                                                               <span class="fileName">' + fileName + ' (' + byteSize + suffix + ')</span><span class="percentage"></span>\
+                                                               <div class="uploadifyProgress">\
+                                                                       <div id="' + jQuery(this).attr('id') + ID + 'ProgressBar" class="uploadifyProgressBar"><!--Progress Bar--></div>\
+                                                               </div>\
+                                                       </div>');
+                                       }
+                               });
+                               if (typeof(settings.onSelectOnce) == 'function') {
+                                       jQuery(this).bind("uploadifySelectOnce", settings.onSelectOnce);
+                               }
+                               jQuery(this).bind("uploadifyQueueFull", {'action': settings.onQueueFull}, function(event, queueSizeLimit) {
+                                       if (event.data.action(event, queueSizeLimit) !== false) {
+                                               alert('The queue is full.  The max size is ' + queueSizeLimit + '.');
+                                       }
+                               });
+                               jQuery(this).bind("uploadifyCheckExist", {'action': settings.onCheck}, function(event, checkScript, fileQueueObj, folder, single) {
+                                       var postData = new Object();
+                                       postData = fileQueueObj;
+                                       postData.folder = pagePath + folder;
+                                       if (single) {
+                                               for (var ID in fileQueueObj) {
+                                                       var singleFileID = ID;
+                                               }
+                                       }
+                                       jQuery.post(checkScript, postData, function(data) {
+                                               for(var key in data) {
+                                                       if (event.data.action(event, checkScript, fileQueueObj, folder, single) !== false) {
+                                                               var replaceFile = confirm("Do you want to replace the file " + data[key] + "?");
+                                                               if (!replaceFile) {
+                                                                       document.getElementById(jQuery(event.target).attr('id') + 'Uploader').cancelFileUpload(key, true,true);
+                                                               }
+                                                       }
+                                               }
+                                               if (single) {
+                                                       document.getElementById(jQuery(event.target).attr('id') + 'Uploader').startFileUpload(singleFileID, true);
+                                               } else {
+                                                       document.getElementById(jQuery(event.target).attr('id') + 'Uploader').startFileUpload(null, true);
+                                               }
+                                       }, "json");
+                               });
+                               jQuery(this).bind("uploadifyCancel", {'action': settings.onCancel}, function(event, ID, fileObj, data, clearFast) {
+                                       if (event.data.action(event, ID, fileObj, data, clearFast) !== false) {
+                                               var fadeSpeed = (clearFast == true) ? 0 : 250;
+                                               jQuery("#" + jQuery(this).attr('id') + ID).fadeOut(fadeSpeed, function() { jQuery(this).remove() });
+                                       }
+                               });
+                               if (typeof(settings.onClearQueue) == 'function') {
+                                       jQuery(this).bind("uploadifyClearQueue", settings.onClearQueue);
+                               }
+                               var errorArray = [];
+                               jQuery(this).bind("uploadifyError", {'action': settings.onError}, function(event, ID, fileObj, errorObj) {
+                                       if (event.data.action(event, ID, fileObj, errorObj) !== false) {
+                                               var fileArray = new Array(ID, fileObj, errorObj);
+                                               errorArray.push(fileArray);
+                                               jQuery("#" + jQuery(this).attr('id') + ID + " .percentage").text(" - " + errorObj.type + " Error");
+                                               jQuery("#" + jQuery(this).attr('id') + ID).addClass('uploadifyError');
+                                       }
+                               });
+                               jQuery(this).bind("uploadifyProgress", {'action': settings.onProgress, 'toDisplay': settings.displayData}, function(event, ID, fileObj, data) {
+                                       if (event.data.action(event, ID, fileObj, data) !== false) {
+                                               jQuery("#" + jQuery(this).attr('id') + ID + "ProgressBar").css('width', data.percentage + '%');
+                                               if (event.data.toDisplay == 'percentage') displayData = ' - ' + data.percentage + '%';
+                                               if (event.data.toDisplay == 'speed') displayData = ' - ' + data.speed + 'KB/s';
+                                               if (event.data.toDisplay == null) displayData = ' ';
+                                               jQuery("#" + jQuery(this).attr('id') + ID + " .percentage").text(displayData);
+                                       }
+                               });
+                               jQuery(this).bind("uploadifyComplete", {'action': settings.onComplete}, function(event, ID, fileObj, response, data) {
+                                       if (event.data.action(event, ID, fileObj, unescape(response), data) !== false) {
+                                               jQuery("#" + jQuery(this).attr('id') + ID + " .percentage").text(' - Completed');
+                                               jQuery("#" + jQuery(this).attr('id') + ID).fadeOut(250, function() { jQuery(this).remove()});
+                                       }
+                               });
+                               if (typeof(settings.onAllComplete) == 'function') {
+                                       jQuery(this).bind("uploadifyAllComplete", {'action': settings.onAllComplete}, function(event, uploadObj) {
+                                               if (event.data.action(event, uploadObj) !== false) {
+                                                       errorArray = [];
+                                               }
+                                       });
+                               }
+                       });
+               },
+               uploadifySettings:function(settingName, settingValue, resetObject) {
+                       var returnValue = false;
+                       jQuery(this).each(function() {
+                               if (settingName == 'scriptData' && settingValue != null) {
+                                       if (resetObject) {
+                                               var scriptData = settingValue;
+                                       } else {
+                                               var scriptData = jQuery.extend(settings.scriptData, settingValue);
+                                       }
+                                       var scriptDataString = '';
+                                       for (var name in scriptData) {
+                                               scriptDataString += '&' + name + '=' + escape(scriptData[name]);
+                                       }
+                                       settingValue = scriptDataString.substr(1);
+                               }
+                               returnValue = document.getElementById(jQuery(this).attr('id') + 'Uploader').updateSettings(settingName, settingValue);
+                       });
+                       if (settingValue == null) {
+                               if (settingName == 'scriptData') {
+                                       var returnSplit = unescape(returnValue).split('&');
+                                       var returnObj   = new Object();
+                                       for (var i = 0; i < returnSplit.length; i++) {
+                                               var iSplit = returnSplit[i].split('=');
+                                               returnObj[iSplit[0]] = iSplit[1];
+                                       }
+                                       returnValue = returnObj;
+                               }
+                               return returnValue;
+                       }
+               },
+               uploadifyUpload:function(ID) {
+                       jQuery(this).each(function() {
+                               document.getElementById(jQuery(this).attr('id') + 'Uploader').startFileUpload(ID, false);
+                       });
+               },
+               uploadifyCancel:function(ID) {
+                       jQuery(this).each(function() {
+                               document.getElementById(jQuery(this).attr('id') + 'Uploader').cancelFileUpload(ID, true, false);
+                       });
+               },
+               uploadifyClearQueue:function() {
+                       jQuery(this).each(function() {
+                               document.getElementById(jQuery(this).attr('id') + 'Uploader').clearFileUploadQueue(false);
+                       });
+               }
+       })
 })(jQuery);
\ No newline at end of file
index 04592ff..4305311 100644 (file)
@@ -1,26 +1,26 @@
-/*\r
-Uploadify v2.1.0\r
-Release Date: August 24, 2009\r
-\r
-Copyright (c) 2009 Ronnie Garcia, Travis Nickels\r
-\r
-Permission is hereby granted, free of charge, to any person obtaining a copy\r
-of this software and associated documentation files (the "Software"), to deal\r
-in the Software without restriction, including without limitation the rights\r
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
-copies of the Software, and to permit persons to whom the Software is\r
-furnished to do so, subject to the following conditions:\r
-\r
-The above copyright notice and this permission notice shall be included in\r
-all copies or substantial portions of the Software.\r
-\r
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
-THE SOFTWARE.\r
-*/\r
-\r
+/*
+Uploadify v2.1.0
+Release Date: August 24, 2009
+
+Copyright (c) 2009 Ronnie Garcia, Travis Nickels
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
 if(jQuery){(function(a){a.extend(a.fn,{uploadify:function(b){a(this).each(function(){settings=a.extend({id:a(this).attr("id"),uploader:"uploadify.swf",script:"uploadify.php",expressInstall:null,folder:"",height:30,width:110,cancelImg:"cancel.png",wmode:"opaque",scriptAccess:"sameDomain",fileDataName:"Filedata",method:"POST",queueSizeLimit:999,simUploadLimit:1,queueID:false,displayData:"percentage",onInit:function(){},onSelect:function(){},onQueueFull:function(){},onCheck:function(){},onCancel:function(){},onError:function(){},onProgress:function(){},onComplete:function(){},onAllComplete:function(){}},b);var e=location.pathname;e=e.split("/");e.pop();e=e.join("/")+"/";var f={};f.uploadifyID=settings.id;f.pagepath=e;if(settings.buttonImg){f.buttonImg=escape(settings.buttonImg)}if(settings.buttonText){f.buttonText=escape(settings.buttonText)}if(settings.rollover){f.rollover=true}f.script=settings.script;f.folder=escape(settings.folder);if(settings.scriptData){var g="";for(var d in settings.scriptData){g+="&"+d+"="+settings.scriptData[d]}f.scriptData=escape(g.substr(1))}f.width=settings.width;f.height=settings.height;f.wmode=settings.wmode;f.method=settings.method;f.queueSizeLimit=settings.queueSizeLimit;f.simUploadLimit=settings.simUploadLimit;if(settings.hideButton){f.hideButton=true}if(settings.fileDesc){f.fileDesc=settings.fileDesc}if(settings.fileExt){f.fileExt=settings.fileExt}if(settings.multi){f.multi=true}if(settings.auto){f.auto=true}if(settings.sizeLimit){f.sizeLimit=settings.sizeLimit}if(settings.checkScript){f.checkScript=settings.checkScript}if(settings.fileDataName){f.fileDataName=settings.fileDataName}if(settings.queueID){f.queueID=settings.queueID}if(settings.onInit()!==false){a(this).css("display","none");a(this).after('<div id="'+a(this).attr("id")+'Uploader"></div>');swfobject.embedSWF(settings.uploader,settings.id+"Uploader",settings.width,settings.height,"9.0.24",settings.expressInstall,f,{quality:"high",wmode:settings.wmode,allowScriptAccess:settings.scriptAccess});if(settings.queueID==false){a("#"+a(this).attr("id")+"Uploader").after('<div id="'+a(this).attr("id")+'Queue" class="uploadifyQueue"></div>')}}if(typeof(settings.onOpen)=="function"){a(this).bind("uploadifyOpen",settings.onOpen)}a(this).bind("uploadifySelect",{action:settings.onSelect,queueID:settings.queueID},function(j,h,i){if(j.data.action(j,h,i)!==false){var k=Math.round(i.size/1024*100)*0.01;var l="KB";if(k>1000){k=Math.round(k*0.001*100)*0.01;l="MB"}var m=k.toString().split(".");if(m.length>1){k=m[0]+"."+m[1].substr(0,2)}else{k=m[0]}if(i.name.length>20){fileName=i.name.substr(0,20)+"..."}else{fileName=i.name}queue="#"+a(this).attr("id")+"Queue";if(j.data.queueID){queue="#"+j.data.queueID}a(queue).append('<div id="'+a(this).attr("id")+h+'" class="uploadifyQueueItem"><div class="cancel"><a href="javascript:jQuery(\'#'+a(this).attr("id")+"').uploadifyCancel('"+h+'\')"><img src="'+settings.cancelImg+'" border="0" /></a></div><span class="fileName">'+fileName+" ("+k+l+')</span><span class="percentage"></span><div class="uploadifyProgress"><div id="'+a(this).attr("id")+h+'ProgressBar" class="uploadifyProgressBar"><!--Progress Bar--></div></div></div>')}});if(typeof(settings.onSelectOnce)=="function"){a(this).bind("uploadifySelectOnce",settings.onSelectOnce)}a(this).bind("uploadifyQueueFull",{action:settings.onQueueFull},function(h,i){if(h.data.action(h,i)!==false){alert("The queue is full.  The max size is "+i+".")}});a(this).bind("uploadifyCheckExist",{action:settings.onCheck},function(m,l,k,j,o){var i=new Object();i=k;i.folder=e+j;if(o){for(var h in k){var n=h}}a.post(l,i,function(r){for(var p in r){if(m.data.action(m,l,k,j,o)!==false){var q=confirm("Do you want to replace the file "+r[p]+"?");if(!q){document.getElementById(a(m.target).attr("id")+"Uploader").cancelFileUpload(p,true,true)}}}if(o){document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(n,true)}else{document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(null,true)}},"json")});a(this).bind("uploadifyCancel",{action:settings.onCancel},function(l,h,k,m,j){if(l.data.action(l,h,k,m,j)!==false){var i=(j==true)?0:250;a("#"+a(this).attr("id")+h).fadeOut(i,function(){a(this).remove()})}});if(typeof(settings.onClearQueue)=="function"){a(this).bind("uploadifyClearQueue",settings.onClearQueue)}var c=[];a(this).bind("uploadifyError",{action:settings.onError},function(l,h,k,j){if(l.data.action(l,h,k,j)!==false){var i=new Array(h,k,j);c.push(i);a("#"+a(this).attr("id")+h+" .percentage").text(" - "+j.type+" Error");a("#"+a(this).attr("id")+h).addClass("uploadifyError")}});a(this).bind("uploadifyProgress",{action:settings.onProgress,toDisplay:settings.displayData},function(j,h,i,k){if(j.data.action(j,h,i,k)!==false){a("#"+a(this).attr("id")+h+"ProgressBar").css("width",k.percentage+"%");if(j.data.toDisplay=="percentage"){displayData=" - "+k.percentage+"%"}if(j.data.toDisplay=="speed"){displayData=" - "+k.speed+"KB/s"}if(j.data.toDisplay==null){displayData=" "}a("#"+a(this).attr("id")+h+" .percentage").text(displayData)}});a(this).bind("uploadifyComplete",{action:settings.onComplete},function(k,h,j,i,l){if(k.data.action(k,h,j,unescape(i),l)!==false){a("#"+a(this).attr("id")+h+" .percentage").text(" - Completed");a("#"+a(this).attr("id")+h).fadeOut(250,function(){a(this).remove()})}});if(typeof(settings.onAllComplete)=="function"){a(this).bind("uploadifyAllComplete",{action:settings.onAllComplete},function(h,i){if(h.data.action(h,i)!==false){c=[]}})}})},uploadifySettings:function(f,j,c){var g=false;a(this).each(function(){if(f=="scriptData"&&j!=null){if(c){var i=j}else{var i=a.extend(settings.scriptData,j)}var l="";for(var k in i){l+="&"+k+"="+escape(i[k])}j=l.substr(1)}g=document.getElementById(a(this).attr("id")+"Uploader").updateSettings(f,j)});if(j==null){if(f=="scriptData"){var b=unescape(g).split("&");var e=new Object();for(var d=0;d<b.length;d++){var h=b[d].split("=");e[h[0]]=h[1]}g=e}return g}},uploadifyUpload:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").startFileUpload(b,false)})},uploadifyCancel:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").cancelFileUpload(b,true,false)})},uploadifyClearQueue:function(){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").clearFileUploadQueue(false)})}})})(jQuery)};
\ No newline at end of file
index 8eafe9d..acc7da4 100644 (file)
@@ -1,4 +1,4 @@
-/*     SWFObject v2.2 <http://code.google.com/p/swfobject/> 
-       is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
+/*     SWFObject v2.2 <http://code.google.com/p/swfobject/>
+       is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
 */
 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}}}}();
\ No newline at end of file
index f652612..2ac0a28 100644 (file)
@@ -1,5 +1,5 @@
 {% load i18n adminmedia fb_tags fb_versions %}
-<tr class="{% cycle 'row1' 'row2' %}">    
+<tr class="{% cycle 'row1' 'row2' %}">
     <!-- FILESELECT FOR FILEBROWSEFIELD -->
     {% ifequal query.pop '1' %}
     {% if results_var.select_total %}
@@ -13,7 +13,7 @@
     </td>
     {% endif %}
     {% endifequal %}
-    
+
     <!-- FILESELECT FOR RTE/TINYMCE -->
     {% ifequal query.pop '2' %}
     {% if results_var.select_total %}
@@ -27,7 +27,7 @@
     </td>
     {% endif %}
     {% endifequal %}
-    
+
     <!-- FILESELECT FOR CKEDITOR (FORMER "FCKEDITOR") -->
     {% ifequal query.pop '3' %}
     {% if results_var.select_total %}
     </td>
     {% endif %}
     {% endifequal %}
-    
+
     <!-- SHOW VERSIONS -->
     {% if settings_var.ADMIN_VERSIONS and results_var.images_total %}
     <td class="fb_icon">
         {% ifequal file.filetype 'Image' %}<a href="{% url fb_versions %}{% query_string %}&amp;filename={{ file.filename }}" class="fb_showversionslink" title="{% trans 'Show Versions' %}"></a>{% endifequal %}
     </td>
     {% endif %}
-    
+
     <!-- FILEICON -->
     <td class="fb_icon"><img src="{{ settings_var.URL_FILEBROWSER_MEDIA }}img/filebrowser_type_{{ file.filetype|lower }}.gif" /></td>
-    
+
     <!-- THUMBNAIL -->
     {% if results_var.images_total %}
     <td class="fb_icon">
         {% endifequal %}
     </td>
     {% endif %}
-    
+
     <!-- FILENAME/DIMENSIONS -->
     {% ifequal file.filetype 'Folder' %}
     <td><b><a href="{% url fb_browse %}{% query_string '' 'dir' %}&amp;dir={{ file.path_relative_directory|urlencode }}">{{ file.filename }}</a></b></td>
     {% else %}
     <td><b><a href="{{ file.url_full }}">{{ file.filename }}</a></b>{% if file.dimensions %}<br /><span class="tiny">{{ file.dimensions.0 }} x {{ file.dimensions.1 }} px</span>{% endif %}</td>
     {% endifequal %}
-    
+
     <!-- RENAME -->
     <td class="fb_icon"><a href="{% url fb_rename %}{% query_string %}&amp;filename={{ file.filename }}" class="fb_renamelink" title="{% trans 'Rename' %}"></a></td>
-    
+
     <!-- SIZE -->
     <td>{{ file.filesize|filesizeformat }}</td>
-    
+
     <!-- DATE -->
     <td>{{ file.datetime|date:"N j, Y" }}</td>
-    
+
     <!-- DELETE -->
     {% if results_var.delete_total %}
     <td class="fb_icon">
@@ -89,7 +89,7 @@
         {% endifnotequal %}
     </td>
     {% endif %}
-    
+
     <!-- DEBUG -->
     {% if settings_var.DEBUG %}
     <td>
         {% endifequal %}
     </td>
     {% endif %}
-    
+
 </tr>
index 1e6e816..0d60e6d 100644 (file)
@@ -5,32 +5,32 @@
     {% ifequal query.pop '1' %}{% if results_var.select_total %}<th></th>{% endif %}{% endifequal %}
     {% ifequal query.pop '2' %}{% if results_var.select_total %}<th></th>{% endif %}{% endifequal %}
     {% ifequal query.pop '3' %}{% if results_var.select_total %}<th></th>{% endif %}{% endifequal %}
-    
+
     <!-- SHOW VERSIONS -->
     {% if settings_var.ADMIN_VERSIONS and results_var.images_total %}<th>&nbsp;</th>{% endif %}
-    
+
     <!-- FILETYPE -->
     {% ifequal query.o 'filetype_checked' %}<th class="sorted {{ query.ot }}ending"><a href="{% query_string "" "o,ot" %}&amp;ot={% ifequal query.ot 'desc' %}asc{% else %}desc{% endifequal %}&amp;o=filetype_checked"></a></th>{% endifequal %}
     {% ifnotequal query.o 'filetype_checked' %}<th><a href="{% query_string "" "o,ot" %}&amp;ot=asc&amp;o=filetype_checked">&nbsp;</a></th>{% endifnotequal %}
-    
+
     <!-- THUMB -->
     {% if results_var.images_total %}<th>&nbsp;</th>{% endif %}
-    
+
     <!-- FILENAME / DIMENSIONS  -->
     {% ifequal query.o 'filename_lower' %}<th class="sorted {{ query.ot }}ending"><a href="{% query_string "" "o,ot" %}&amp;ot={% ifequal query.ot 'desc' %}asc{% else %}desc{% endifequal %}&amp;o=filename_lower">{% trans 'Filename' %}</a></th>{% endifequal %}
     {% ifnotequal query.o 'filename_lower' %}<th><a href="{% query_string "" "o,ot" %}&amp;ot=asc&amp;o=filename_lower">{% trans 'Filename' %}</a></th>{% endifnotequal %}
-    
+
     <!-- RENAME -->
     <th>&nbsp;</th>
-    
+
     <!-- SIZE -->
     {% ifequal query.o 'filesize' %}<th class="sorted {{ query.ot }}ending"><a href="{% query_string "" "o,ot" %}&amp;ot={% ifequal query.ot 'desc' %}asc{% else %}desc{% endifequal %}&amp;o=filesize">{% trans 'Size' %}</a></th>{% endifequal %}
     {% ifnotequal query.o 'filesize' %}<th><a href="{% query_string "" "o,ot" %}&amp;ot=asc&amp;o=filesize">{% trans 'Size' %}</a></th>{% endifnotequal %}
-    
+
     <!-- DATE -->
     {% ifequal query.o 'date' %}<th class="sorted {{ query.ot }}ending"><a href="{% query_string "" "o,ot" %}&amp;ot={% ifequal query.ot 'desc' %}asc{% else %}desc{% endifequal %}&amp;o=date">{% trans 'Date' %}</a></th>{% endifequal %}
     {% ifnotequal query.o 'date' %}<th><a href="{% query_string "" "o,ot" %}&amp;ot=asc&amp;o=date">{% trans 'Date' %}</a></th>{% endifnotequal %}
-    
+
     <!-- DELETE -->
     {% if results_var.delete_total %}<th>&nbsp;</th>{% endif %}
     {% if settings_var.DEBUG %}<th>Debug</th>{% endif %}
index 7fe19ab..2a4466f 100644 (file)
@@ -46,7 +46,7 @@
         <fieldset class="module aligned collapse">
         <h2>{% trans "Help" %}</h2>
         <div class="form-row" >
-            <label class="required">&nbsp;</label> 
+            <label class="required">&nbsp;</label>
             <p>
                 {{ form.dir_name.help_text|safe }}
                 {% if settings_var.CONVERT_FILENAME %}<br />{% trans "The Name will be converted to lowercase. Spaces will be replaced with underscores." %}{% endif %}
index 31ddc0a..4c12830 100644 (file)
@@ -47,7 +47,7 @@
         <fieldset class="module aligned collapse">
         <h2>{% trans "Help" %}</h2>
         <div class="form-row" >
-            <label class="required">&nbsp;</label> 
+            <label class="required">&nbsp;</label>
             <p>
                 {{ form.name.help_text|safe }}
                 {% if settings_var.CONVERT_FILENAME %}<br />{% trans "The Name will be converted to lowercase. Spaces will be replaced with underscores." %}{% endif %}
index 2736a3c..fed793e 100644 (file)
             <input type="File" id="id_file" />
         </div>
         </fieldset>
-        
+
         <fieldset class="module aligned collapse">
         <h2>{% trans "Help" %}</h2>
         <div class="form-row" >
             {% for extension in settings_var.EXTENSIONS.items %}
             {% ifnotequal extension.0 'Folder' %}
-            <label class="required">{% if forloop.first %}{% trans "Allowed" %}:{% else %}&nbsp;{% endif %}</label> 
+            <label class="required">{% if forloop.first %}{% trans "Allowed" %}:{% else %}&nbsp;{% endif %}</label>
             <p>{{ extension.0|safe }} ({{ extension.1|join:", "|safe }})</p>
             {% endifnotequal %}
             {% endfor %}
         </div>
         {% endif %}
         </fieldset>
-        
+
         <div class="submit-row">
             <p class="deletelink-box">
                 <a class="deletelink" href="javascript:$('#id_file').uploadifyClearQueue()">{% trans "Clear Queue" %}</a>
             </p>
             <input class="default" type="submit" name="_save" value='{% trans "Upload" %}' />
         </div>
-        
+
     </div>
     </form>
 </div>
index b038c04..05093a3 100644 (file)
                     <strong>Extension</strong> {{ image_version.extension }}<br />
                     <strong>Date</strong> {{ image_version.date }}<br />
                     <strong>Datetime Object</strong> {{ image_version.datetime }}<br /><br />
-                    
+
                     <strong>Relative Path</strong> {{ image_version.path_relative }}<br />
                     <strong>Full Path</strong> {{ image_version.path_full }}<br />
                     <strong>Relative URL</strong> {{ image_version.url_relative }}<br />
                     <strong>Full URL</strong> {{ image_version.url_full }}<br /><br />
-                    
+
                     <strong>URL for FileBrowseField</strong> {{ image_version.url_save }}<br />
                     <strong>Thumbnail URL</strong> {{ image_version.url_thumbnail }}<br /><br />
-                    
+
                     <strong>Dimensions</strong> {{ image_version.dimensions }}<br />
                     <strong>Width</strong> {{ image_version.width }}<br />
                     <strong>Height</strong> {{ image_version.height }}<br />
index 2ecb1ab..a43cb93 100644 (file)
@@ -1,13 +1,13 @@
-{% if button.link %}\r
-<a href="{{button.link}}" target="_new">\r
-{% endif %}\r
-<button type="button"\r
-       data-ui-action="{{ button.scriptlet_id }}"\r
-       data-ui-action-params="{{ button.params|escape }}"\r
-       data-ui-accesskey="{{ button.accesskey }}"\r
-       {% if button.tooltip %}title="{{ button.full_tooltip }}"{% endif %} >\r
-       {{ button.label|safe }}\r
-</button>\r
-{% if button.link %}\r
-</a>\r
+{% if button.link %}
+<a href="{{button.link}}" target="_new">
+{% endif %}
+<button type="button"
+       data-ui-action="{{ button.scriptlet_id }}"
+       data-ui-action-params="{{ button.params|escape }}"
+       data-ui-accesskey="{{ button.accesskey }}"
+       {% if button.tooltip %}title="{{ button.full_tooltip }}"{% endif %} >
+       {{ button.label|safe }}
+</button>
+{% if button.link %}
+</a>
 {% endif %}
\ No newline at end of file
index a69dc3b..f7a5d7e 100644 (file)
@@ -5,11 +5,11 @@
         <option value="{{ group.slug }}" {% if forloop.first %}selected="selected"{% endif %}>{{ group.name }}</option>
         {% endfor %}
     </select>
-    
+
     <div class="toolbar-button-groups-container">
         {% for group in toolbar_groups %}
         <div data-group="{{group.slug}}" class="toolbar-buttons-container">
-            {# buttons for this group #}            
+            {# buttons for this group #}
             {% for button in group.button_set.all %}
             {% toolbar_button button %}
             {% endfor %}
diff --git a/apps/wiki/constants.py b/apps/wiki/constants.py
new file mode 100644 (file)
index 0000000..472bbb6
--- /dev/null
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+from django.utils.translation import ugettext_lazy as _
+
+DOCUMENT_TAGS = (
+    ("source", _(u"Tekst źródłowy")),
+    ("first_correction", _(u"Po autokorekcie")),
+    ("tagged", _(u"Tekst otagowany")),
+    ("second_correction", _(u"Po korekcie")),
+    ("source_annotations", _(u"Sprawdzone przypisy źródła")),
+    ("language_updates", _(u"Uwspółcześnienia")),
+    ("ready_to_publish", _(u"Tekst do publikacji")),
+)
+
+DOCUMENT_TAGS_DICT = dict(DOCUMENT_TAGS)
+
+DOCUMENT_STAGES = (
+    ("first_correction", _(u"Autokorekta")),
+    ("tagged", _(u"Tagowanie")),
+    ("second_correction", _(u"Korekta")),
+    ("source_annotations", _(u"Przypisy źródła")),
+    ("language_updates", _(u"Uwspółcześnienia")),
+)
+
+DOCUMENT_STAGES_DICT = dict(DOCUMENT_STAGES)
index 2bd6e64..4fb71a5 100644 (file)
@@ -5,6 +5,7 @@
 #
 from django import forms
 from wiki.models import Document, getstorage
+from wiki.constants import DOCUMENT_TAGS, DOCUMENT_STAGES
 from django.utils.translation import ugettext_lazy as _
 
 
@@ -38,12 +39,10 @@ class DocumentForm(forms.Form):
 
 
 class DocumentTagForm(forms.Form):
-    TAGS = (
-        ("publish", "Do publikacji"),
-    )
 
-    tag = forms.ChoiceField(choices=TAGS)
-    version = forms.IntegerField(widget=forms.HiddenInput)
+    id = forms.CharField(widget=forms.HiddenInput)
+    tag = forms.ChoiceField(choices=DOCUMENT_TAGS)
+    revision = forms.IntegerField(widget=forms.HiddenInput)
 
 
 class DocumentTextSaveForm(forms.Form):
@@ -56,12 +55,6 @@ class DocumentTextSaveForm(forms.Form):
         * stage_completed - mark this change as end of given stage.
 
     """
-    DOC_STAGES = (
-        ('', 'Nic konkretnego'),
-        ('tagging', 'Tagowanie'),
-        ('modernized', 'Uwspółcześnienia'),
-        ('editing', 'Redakcja'),
-    )
 
     id = forms.CharField(widget=forms.HiddenInput)
     parent_revision = forms.IntegerField(widget=forms.HiddenInput)
@@ -81,7 +74,7 @@ class DocumentTextSaveForm(forms.Form):
     )
 
     stage_completed = forms.ChoiceField(
-        choices=DOC_STAGES,
+        choices=DOCUMENT_STAGES,
         required=False,
         label=_(u"Skończyłem robić"),
         help_text=_(u"Jeśli skończyłeś jeden z etapów utworu, wybierz go."),
index d4daf1a..553b1e4 100644 (file)
@@ -1,8 +1,8 @@
 from django import http
 from django.utils import simplejson as json
 from django.utils.functional import Promise
-from django.template.loader import render_to_string
 from datetime import datetime
+from functools import wraps
 
 
 class ExtendedEncoder(json.JSONEncoder):
@@ -39,3 +39,23 @@ class JSONServerError(JSONResponse):
     def __init__(self, *args, **kwargs):
         kwargs['status'] = 500
         super(JSONServerError, self).__init__(*args, **kwargs)
+
+
+def ajax_login_required(view):
+    @wraps(view)
+    def authenticated_view(request, *args, **kwargs):
+        if not request.user.is_authenticated():
+            return http.HttpResponse("Login required.", status=401, mimetype="text/plain")
+        return view(request, *args, **kwargs)
+    return authenticated_view
+
+
+def ajax_require_permission(permission):
+    def decorator(view):
+        @wraps(view)
+        def authorized_view(request, *args, **kwargs):
+            if not request.user.has_perm(permission):
+                return http.HttpResponse("Access Forbidden.", status=403, mimetype="text/plain")
+            return view(request, *args, **kwargs)
+        return authorized_view
+    return decorator
index e4ac728..49bd06c 100644 (file)
@@ -67,10 +67,10 @@ class Document(object):
         except DocumentNotFound:
             return - 1
 
-    def add_tag(self, tag):
+    def add_tag(self, tag, revision, author):
         """ Add document specific tag """
-        logger.debug("Adding tag %s to doc %s version %d", tag, self.name, self.revision)
-        self.storage.vstorage.add_page_tag(self.name, self.revision, tag)
+        logger.debug("Adding tag %s to doc %s version %d", tag, self.name, revision)
+        self.storage.vstorage.add_page_tag(self.name, revision, tag, user=author)
 
     @property
     def plain_text(self):
index 6f6e607..b228fad 100755 (executable)
@@ -5,6 +5,7 @@
 #
 import difflib
 import re
+from collections import deque
 
 from django.template.loader import render_to_string
 from django.utils.html import escape as html_escape
@@ -21,10 +22,39 @@ def filter_line(line):
     return  DIFF_RE.sub(diff_replace, html_escape(line)).replace('\x01', '</span>')
 
 
-def html_diff_table(la, lb):
+def format_changeset(a, b, change):
+    return (a[0], filter_line(a[1]), b[0], filter_line(b[1]), change)
+
+
+def html_diff_table(la, lb, context=None):
+    all_changes = difflib._mdiff(la, lb)
+
+    if context is None:
+        changes = (format_changeset(*c) for c in all_changes)
+    else:
+        changes = []
+        q = deque()
+        after_change = False
+
+        for changeset in all_changes:
+            q.append(changeset)
+
+            if changeset[2]:
+                after_change = True
+                if not after_change:
+                    changes.append((0, '-----', 0, '-----', False))
+                changes.extend(format_changeset(*c) for c in q)
+                q.clear()
+            else:
+                if len(q) == context and after_change:
+                    changes.extend(format_changeset(*c) for c in q)
+                    q.clear()
+                    after_change = False
+                elif len(q) > context:
+                    q.popleft()
+
     return render_to_string("wiki/diff_table.html", {
-        "changes": [(a[0], filter_line(a[1]), b[0], filter_line(b[1]), change)
-                        for a, b, change in difflib._mdiff(la, lb)],
+        "changes": changes,
     })
 
 
index 9031d19..22e07e1 100644 (file)
@@ -26,7 +26,7 @@
 
 <div id="document-meta"
        data-document-name="{{ document.name }}" style="display:none">
-       
+
        {% for k, v in document_meta.items %}
                <span data-key="{{ k }}">{{ v }}</span>
        {% endfor %}
     <h1><a href="{% url wiki.views.document_list %}">Platforma</a></h1>
     <div id="tools">
         <a href="{{ REDMINE_URL }}projects/wl-publikacje/wiki/Pomoc" target="_blank">Pomoc</a>
-        | {% include "registration/head_login.html" %} 
+        | {% include "registration/head_login.html" %}
         | Wersja: <span id="document-revision">unknown</span>
-        | 
+        |
         <button style="margin-left: 6px" id="save-button">
             Zapisz
         </button>
     </div>
-    <ol id="tabs">     
-               <li id="SummaryPerspective" 
-                       data-ui-related="summary-view-editor" 
+    <ol id="tabs">
+               <li id="SummaryPerspective"
+                       data-ui-related="summary-view-editor"
                        data-ui-jsclass="SummaryPerspective">
             <span>{{ document_meta.title }}</span>
-        </li>          
-               
-        <li id="VisualPerspective" 
-                       data-ui-related="simple-editor" 
+        </li>
+
+        <li id="VisualPerspective"
+                       data-ui-related="simple-editor"
                        data-ui-jsclass="VisualPerspective">
             <span>Edytor</span>
         </li>
-               
-               <li id="HistoryPerspective" 
-                       data-ui-related="history-view-editor" 
-                       data-ui-jsclass="HistoryPerspective">           
+
+               <li id="HistoryPerspective"
+                       data-ui-related="history-view-editor"
+                       data-ui-jsclass="HistoryPerspective">
             <span>Historia</span>
         </li>
-                       
-               <li id="CodeMirrorPerspective" 
-                       data-ui-related="source-editor" 
+
+               <li id="CodeMirrorPerspective"
+                       data-ui-related="source-editor"
                        data-ui-jsclass="CodeMirrorPerspective">
             <span>Kod źródłowy</span>
         </li>
@@ -94,9 +94,9 @@
                {% include "wiki/summary_view.html" %}
     </div>
     <div class="vsplitbar" title="Klinknij aby (ro)zwinąć galerię."> </div>
-    
+
        <div id="side-gallery">
-               <!-- gallery toolbar -->                                
+               <!-- gallery toolbar -->
         <div class="toolbar">
             <button class="previous-page">
                 <img src="{{STATIC_URL}}icons/go-previous.png" alt="Poprzednia" title="Poprzednia"/>
             </button>
             <div class="toolbar-end">
             </div>
-        </div>        
+        </div>
                <div class="error_message"> </div>
                <div class="gallery-image">
                        <img src="{{MEDIA_URL}}/images/empty.png" />
index 415c3bc..a47609a 100644 (file)
 <script type="text/javascript" charset="utf-8">
 $(function() {
        function search(event) {
-        event.preventDefault();        
-        var expr = new RegExp(slugify($('#file-list-filter').val()), 'i');     
-        $('#file-list tbody tr').hide().filter(function(index) {            
+        event.preventDefault();
+        var expr = new RegExp(slugify($('#file-list-filter').val()), 'i');
+        $('#file-list tbody tr').hide().filter(function(index) {
             return expr.test(slugify($('a', this).text()));
         }).show();
     }
-       
+
     $('#file-list-find-button').click(search).hide();
        $('#file-list-filter').bind('keyup change DOMAttrModified', search);
 });
@@ -28,14 +28,14 @@ $(function() {
 
 
 <div id="document-list">
-       <form method="get" action="#">           
+       <form method="get" action="#">
     <table  id="file-list">
-       <thead>         
+       <thead>
                <tr><th>Filtr:</th>
                        <th><input autocomplete="off" name="filter" id="file-list-filter" type="text" size="40" /></th>
                        <th><input type="reset" value="Wyczyść" id="file-list-reset-button"/></th>
-                       </tr>           
-               </thead>                
+                       </tr>
+               </thead>
                <tbody>
        {% for file in document_list %}
             <tr>
@@ -46,14 +46,14 @@ $(function() {
                </tbody>
     </table>
        </form>
-       
+
        <div id="last-edited-list">
                <h2>Twoje ostatnio otwierane dokumenty:</h2>
                <ol>
                        {% for   name, date in last_docs %}
                        <li><a href="{% url wiki.views.document_detail name|urlencode %}"
                                target="_blank">{{ name }}</a><br/><span class="date">({{ date|date:"H:i:s, d/m/Y" }})</span></li>
-                       {% endfor %}                    
+                       {% endfor %}
                </ol>
        </div>
 </div>
index 36be487..58b5415 100644 (file)
@@ -1,28 +1,26 @@
 <div id="history-view-editor" class="editor" style="display: none">
     <div class="toolbar">
-       <button type="button" id="make-diff-button">Porównaj</button> 
+       <button type="button" id="make-diff-button">Porównaj</button>
                <button type="button" id="tag-changeset-button">Oznacz wersje</button>
-       </div> 
+       </div>
     <div id="history-view">
         <p class="message-box" style="display:none;"></p>
-               
+
                <table id="changes-list-container">
-        <tbody id="changes-list">              
+        <tbody id="changes-list">
         </tbody>
                <tbody style="display: none;">
-                       <tr class="entry row-stub">                     
+                       <tr class="entry row-stub">
                        <td data-stub-value="version"></td>
                        <td>
                                <span data-stub-value="description"></span>
                                <br />
                <span data-stub-value="author"></span>, <span data-stub-value="date"></span>
                        </td>
-                       <td data-stub-value="tag">                              
+                       <td data-stub-value="tag">
                        </td>
                </tr>
                </tbody>
-               </table>                   
-        <div id="diff-view">
-        </div>
+               </table>
     </div>
 </div>
index aba61cc..3003991 100644 (file)
@@ -1,40 +1,40 @@
 <div id="save_dialog" class="dialog" data-ui-jsclass="SaveDialog">
-       <form method="POST" action="">
+       <form method="POST" action="#">
        <p>{{ forms.text_save.comment.label }}</p>
        <p class="help_text">
                {{ forms.text_save.comment.help_text}}
                <span data-ui-error-for="{{ forms.text_save.comment.name }}"> </span>
        </p>
        {{forms.text_save.comment }}
-       
-       
-       
+
+
+
        {% if request.user.is_anonymous %}
        <p>
-               {{ forms.text_save.author.label }}: 
+               {{ forms.text_save.author.label }}:
                {{ forms.text_save.author }}
                <span class="help_text">{{ forms.text_save.author.help_text }}</span>
                <span data-ui-error-for="{{ forms.text_save.author.name }}"> </span>
        </p>
        {% else %}
        <p>
-               {{ forms.text_save.stage_completed.label }}: 
+               {{ forms.text_save.stage_completed.label }}:
                {{ forms.text_save.stage_completed }}
                <span class="help_text">{{ forms.text_save.stage_completed.help_text }}</span>
                <span data-ui-error-for="{{ forms.text_save.stage_completed.name }}"> </span>
        </p>
        {% endif %}
-       
-       
+
+
        {% for f in forms.text_save.hidden_fields %}
                {{ f }}
        {% endfor %}
-       
+
        <p data-ui-error-for="__all__"> </p>
-       
+
        <p class="action_area">
                <button type="submit" class"ok" data-ui-action="save">Zapisz</button>
                <button type="button" class="cancel" data-ui-action="cancel">Anuluj</button>
-       </p>    
-       </form> 
+       </p>
+       </form>
 </div>
index 3f52aae..2e83cea 100644 (file)
@@ -1,7 +1,7 @@
 <div id="summary-view-editor" class="editor" style="display: none">
     <!-- <div class="toolbar">
     </div> -->
-    <div id="summary-view">            
+    <div id="summary-view">
                <img class="book-cover" src="{{MEDIA_URL}}images/empty.png">
                <form>
                <h2>
                        <span>{{ document.name|urlencode }}</span>
                </p>
                <p>
-                       <label>Aktulana wersja:</label> 
+                       <label>Aktulana wersja:</label>
                        {{ document_info.revision }} ({{document_info.last_update}})
                <p>
                        <label>Ostatnio edytowane przez:</label>
-                       {{document_info.last_comitter}} 
+                       {{document_info.last_comitter}}
                </p>
                <p>
                        <label for="gallery">Link do galerii:</label>
                        <span data-ui-editable="true" data-edit-target="meta.galleryLink"
-                       >{{ document_meta.gallery}}</span>                              
-               </p>                            
+                       >{{ document_meta.gallery}}</span>
+               </p>
                </form>
-       
+
        </div>
 </div>
\ No newline at end of file
index 3cc056e..a79a616 100644 (file)
@@ -1,5 +1,19 @@
-<div id="add_tag_dialog" class="dialog">
-       <form method="POST" action="">
-               {{ forms.add_tag.as_p }}
+<div id="add_tag_dialog" class="dialog" data-ui-jsclass="AddTagDialog">
+       <form method="POST" action="#">
+               {% for field in forms.add_tag.visible_fields %}
+               <p>{{ field.label_tag }} {{ field }} <span data-ui-error-for="{{ field.name }}"> </span></p>
+               <p>{{ field.help_text }}</p>
+               {% endfor %}
+
+
+               {% for f in forms.add_tag.hidden_fields %}
+                       {{ f }}
+               {% endfor %}
+               <p data-ui-error-for="__all__"> </p>
+
+               <p class="action_area">
+                       <button type="submit" class"ok" data-ui-action="save">Zapisz</button>
+                       <button type="button" class="cancel" data-ui-action="cancel">Anuluj</button>
+               </p>
        </form>
 </div>
index fa4add3..fae11ef 100644 (file)
@@ -14,6 +14,8 @@ urlpatterns = patterns('wiki.views',
         'document_publish', name="wiki_publish"),
     url(r'^(?P<name>[^/]+)/diff$',
         'document_diff', name="wiki_diff"),
+    url(r'^(?P<name>[^/]+)/tags$',
+        'document_add_tag', name="wiki_add_tag"),
     url(r'^(?P<name>[^/]+)$',
         'document_detail', name="wiki_details"),
 )
index 64e9330..dbc05df 100644 (file)
@@ -1,15 +1,18 @@
 import os
 
 from django.conf import settings
+
 from django.views.generic.simple import direct_to_template
 from django.views.decorators.http import require_POST
-from .helpers import JSONResponse, JSONFormInvalid, JSONServerError
+from wiki.helpers import JSONResponse, JSONFormInvalid, JSONServerError, ajax_require_permission
 from django import http
 
 from wiki.models import getstorage
-from wiki.forms import DocumentForm, DocumentTextSaveForm, DocumentTagForm
+from wiki.forms import DocumentTextSaveForm, DocumentTagForm
 from datetime import datetime
 from django.utils.encoding import smart_unicode
+from django.utils.translation import ugettext_lazy as _
+
 import wlapi
 
 #
@@ -136,29 +139,37 @@ def document_diff(request, name):
     docB = storage.get_or_404(name, int(revB))
 
     return http.HttpResponse(nice_diff.html_diff_table(docA.plain_text.splitlines(),
-                                         docB.plain_text.splitlines()))
+                                         docB.plain_text.splitlines(), context=3))
 
 
 @never_cache
 def document_history(request, name):
     storage = getstorage()
-    return JSONResponse(storage.history(name))
+
+    # TODO: pagination
+    changesets = storage.history(name)
+
+    return JSONResponse(changesets)
 
 
 @require_POST
+@ajax_require_permission('wiki.can_change_tags')
 def document_add_tag(request, name):
     storage = getstorage()
 
     form = DocumentTagForm(request.POST)
     if form.is_valid():
-        doc = storage.get_or_404(name, form.cleaned_data['version'])
-        doc.add_tag(form.cleaned_data['tag'])
+        doc = storage.get_or_404(form.cleaned_data['id'])
+        doc.add_tag(tag=form.cleaned_data['tag'],
+                    revision=form.cleaned_data['revision'],
+                    author=request.user.username)
         return JSONResponse({"message": _("Tag added")})
     else:
         return JSONFormInvalid(form)
 
 
 @require_POST
+@ajax_require_permission('wiki.can_publish')
 def document_publish(request, name, version):
     storage = getstorage()
 
index ae4d22f..f16496d 100644 (file)
@@ -378,7 +378,7 @@ class VersionedStorage(object):
         return text
 
     @with_working_copy_locked
-    def add_page_tag(self, title, rev, tag, user="<wiki>", doctag=True):
+    def add_page_tag(self, title, rev, tag, user, doctag=True):
         if doctag:
             tag = "{title}#{tag}".format(**locals())
 
index db6c98b..4ba9bb7 100644 (file)
@@ -4,5 +4,4 @@
 def settings(request):
     from django.conf import settings
     return {'MEDIA_URL': settings.MEDIA_URL,
-            'STATIC_URL': settings.STATIC_URL,
-            'REDMINE_URL': settings.REDMINE_URL}
+            'STATIC_URL': settings.STATIC_URL}
index e09dfec..e7eab7a 100644 (file)
@@ -106,79 +106,9 @@ TEMPLATE_DIRS = (
 #
 ## Set this to where the CAS server lives
 # CAS_SERVER_URL = "http://cas.fnp.pl/
-CAS_ADMIN_PREFIX = "/admin/"
 CAS_LOGOUT_COMPLETELY = True
 
-# CSS and JS files to compress
-COMPRESS_CSS = {
-    'detail': {
-         'source_filenames': (
-            'css/master.css',
-            'css/gallery.css',
-            'css/history.css',
-            'css/summary.css',
-            'css/html.css',
-            'css/jquery.autocomplete.css',
-            'css/dialogs.css',
-        ),
-        'output_filename': 'compressed/detail_styles_?.css',
-    },
-    'listing': {
-        'source_filenames': (
-            'css/filelist.css',
-        ),
-        'output_filename': 'compressed/listing_styles_?.css',
-     }
-}
-
-COMPRESS_JS = {
-    # everything except codemirror
-    'detail': {
-        'source_filenames': (
-                'js/jquery-1.4.2.min.js',
-                'js/jquery.autocomplete.js',
-                'js/jquery.blockui.js',
-                'js/jquery.elastic.js',
-                'js/button_scripts.js',
-                'js/slugify.js',
-
-                # wiki scripts
-                'js/wiki/wikiapi.js',
-                'js/wiki/base.js',
-                'js/wiki/xslt.js',
-
-                # dialogs
-                'js/wiki/save_dialog.js',
-
-                # views
-                'js/wiki/history_view.js',
-                'js/wiki/summary_view.js',
-                'js/wiki/source_editor.js',
-                'js/wiki/wysiwyg_editor.js',
-                'js/wiki/scan_gallery.js',
-                'js/wiki/diff_view.js',
-
-                # bootstrap
-                'js/wiki/main.js',
-        ),
-        'output_filename': 'compressed/detail_scripts_?.js',
-     },
-    'listing': {
-        'source_filenames': (
-                'js/jquery-1.4.2.min.js',
-                'js/slugify.js',
-        ),
-        'output_filename': 'compressed/listing_scripts_?.js',
-     }
-}
-
-COMPRESS = True
-COMPRESS_CSS_FILTERS = None
-COMPRESS_JS_FILTERS = None
-COMPRESS_AUTO = False
-COMPRESS_VERSION = True
-COMPRESS_VERSIONING = 'compress.versioning.hash.MD5Versioning'
-
+from compress_settings import *
 
 INSTALLED_APPS = (
     'django.contrib.auth',
@@ -188,6 +118,7 @@ INSTALLED_APPS = (
     'django.contrib.admin',
     'django.contrib.admindocs',
 
+    'django_cas',
     'compress',
     'south',
     'sorl.thumbnail',
index 9d03435..1c22868 100644 (file)
@@ -1,4 +1,4 @@
-#save_dialog {
+.dialog {
        display: none;
        padding: 5px;
        text-align: left;
@@ -6,11 +6,6 @@
        background-color: #E1E1E1; /* #e0ffb8; */
 }
 
-#save_dialog textarea {
-       width: 90%;
-       margin: 0.2em 4%;
-}
-
 .dialog .help_text {
        font-size: 11px;
        color: #2e3536;  
@@ -30,3 +25,8 @@
        color: red;
        font-weight: bold;
 }
+
+#save_dialog textarea {
+       width: 90%;
+       margin: 0.2em 4%;
+}
\ No newline at end of file
index 5f3fe96..517d863 100644 (file)
@@ -283,8 +283,10 @@ p { margin: 0;}
 
 img.tabclose {
        padding-left: 8px;
-       width: 10px;
-       height: 10px;
+       width: 16px;
+       height: 16px;   
+       vertical-align: middle;
+       vertical-align: text-bottom;
 }
 
 
index 3a99442..888885f 100644 (file)
@@ -4,7 +4,7 @@ var FileBrowser = {
     // change this
     thumb_prefix: 'thumb_',
     no_thumb: 'filebrowser/img/no_thumb.gif',
-    
+
     init: function() {
         // Deduce admin_media_prefix by looking at the <script>s in the
         // current document and finding the URL of *this* module.
index b0696ce..5e3aa9f 100644 (file)
@@ -1,5 +1,5 @@
 function FileSubmit(FileURL, ThumbURL, FileType) {
-    
+
     // var input_id=window.name.split("___").join(".");
     var input_id=window.name.replace(/____/g,'-').split("___").join(".");
     var preview_id = 'image_' + input_id;
@@ -11,7 +11,7 @@ function FileSubmit(FileURL, ThumbURL, FileType) {
     help = opener.document.getElementById(help_id);
     // set new value for input field
     input.value = FileURL;
-    
+
     if (ThumbURL && FileType != "") {
         // selected file is an image and thumbnail is available:
         // display the preview-image (thumbnail)
index 86d6939..b2d4d60 100644 (file)
@@ -7,10 +7,10 @@ var FileBrowserDialogue = {
     fileSubmit : function (FileURL) {
         var URL = FileURL;
         var win = tinyMCEPopup.getWindowArg("window");
-        
+
         // insert information now
         win.document.getElementById(tinyMCEPopup.getWindowArg("input")).value = URL;
-        
+
         // change width/height & show preview
         if (win.ImageDialog){
             if (win.ImageDialog.getImageData)
@@ -18,7 +18,7 @@ var FileBrowserDialogue = {
             if (win.ImageDialog.showPreviewImage)
                 win.ImageDialog.showPreviewImage(URL);
         }
-        
+
         // close popup window
         tinyMCEPopup.close();
     }
index 760a666..902fc9f 100644 (file)
@@ -2,7 +2,7 @@ function CustomFileBrowser(field_name, url, type, win) {
 
     var cmsURL = "/admin/filebrowser/browse/?pop=2";
     cmsURL = cmsURL + "&type=" + type;
-    
+
     tinyMCE.activeEditor.windowManager.open({
         file: cmsURL,
         width: 820,  // Your dimensions may differ - toy around with them!
@@ -48,27 +48,27 @@ tinyMCE.init({
     file_browser_callback: "CustomFileBrowser",
     relative_urls: false,
     valid_elements : "" +
-    "-p," + 
+    "-p," +
     "a[href|target=_blank|class]," +
     "-strong/-b," +
     "-em/-i," +
-    "-u," + 
-    "-ol," + 
-    "-ul," + 
-    "-li," + 
-    "br," + 
-    "img[class|src|alt=|width|height]," + 
-    "-h2,-h3,-h4," + 
+    "-u," +
+    "-ol," +
+    "-ul," +
+    "-li," +
+    "br," +
+    "img[class|src|alt=|width|height]," +
+    "-h2,-h3,-h4," +
     "-pre," +
-    "-code," + 
+    "-code," +
     "-div",
-    extended_valid_elements: "" + 
-    "a[name|class|href|target|title|onclick]," + 
-    "img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]," + 
-    "br[clearfix]," + 
-    "-p[class<clearfix?summary?code]," + 
-    "h2[class<clearfix],h3[class<clearfix],h4[class<clearfix]," + 
-    "ul[class<clearfix],ol[class<clearfix]," + 
+    extended_valid_elements: "" +
+    "a[name|class|href|target|title|onclick]," +
+    "img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]," +
+    "br[clearfix]," +
+    "-p[class<clearfix?summary?code]," +
+    "h2[class<clearfix],h3[class<clearfix],h4[class<clearfix]," +
+    "ul[class<clearfix],ol[class<clearfix]," +
     "div[class],"
 });
 
index 04592ff..4305311 100644 (file)
@@ -1,26 +1,26 @@
-/*\r
-Uploadify v2.1.0\r
-Release Date: August 24, 2009\r
-\r
-Copyright (c) 2009 Ronnie Garcia, Travis Nickels\r
-\r
-Permission is hereby granted, free of charge, to any person obtaining a copy\r
-of this software and associated documentation files (the "Software"), to deal\r
-in the Software without restriction, including without limitation the rights\r
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
-copies of the Software, and to permit persons to whom the Software is\r
-furnished to do so, subject to the following conditions:\r
-\r
-The above copyright notice and this permission notice shall be included in\r
-all copies or substantial portions of the Software.\r
-\r
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
-THE SOFTWARE.\r
-*/\r
-\r
+/*
+Uploadify v2.1.0
+Release Date: August 24, 2009
+
+Copyright (c) 2009 Ronnie Garcia, Travis Nickels
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
 if(jQuery){(function(a){a.extend(a.fn,{uploadify:function(b){a(this).each(function(){settings=a.extend({id:a(this).attr("id"),uploader:"uploadify.swf",script:"uploadify.php",expressInstall:null,folder:"",height:30,width:110,cancelImg:"cancel.png",wmode:"opaque",scriptAccess:"sameDomain",fileDataName:"Filedata",method:"POST",queueSizeLimit:999,simUploadLimit:1,queueID:false,displayData:"percentage",onInit:function(){},onSelect:function(){},onQueueFull:function(){},onCheck:function(){},onCancel:function(){},onError:function(){},onProgress:function(){},onComplete:function(){},onAllComplete:function(){}},b);var e=location.pathname;e=e.split("/");e.pop();e=e.join("/")+"/";var f={};f.uploadifyID=settings.id;f.pagepath=e;if(settings.buttonImg){f.buttonImg=escape(settings.buttonImg)}if(settings.buttonText){f.buttonText=escape(settings.buttonText)}if(settings.rollover){f.rollover=true}f.script=settings.script;f.folder=escape(settings.folder);if(settings.scriptData){var g="";for(var d in settings.scriptData){g+="&"+d+"="+settings.scriptData[d]}f.scriptData=escape(g.substr(1))}f.width=settings.width;f.height=settings.height;f.wmode=settings.wmode;f.method=settings.method;f.queueSizeLimit=settings.queueSizeLimit;f.simUploadLimit=settings.simUploadLimit;if(settings.hideButton){f.hideButton=true}if(settings.fileDesc){f.fileDesc=settings.fileDesc}if(settings.fileExt){f.fileExt=settings.fileExt}if(settings.multi){f.multi=true}if(settings.auto){f.auto=true}if(settings.sizeLimit){f.sizeLimit=settings.sizeLimit}if(settings.checkScript){f.checkScript=settings.checkScript}if(settings.fileDataName){f.fileDataName=settings.fileDataName}if(settings.queueID){f.queueID=settings.queueID}if(settings.onInit()!==false){a(this).css("display","none");a(this).after('<div id="'+a(this).attr("id")+'Uploader"></div>');swfobject.embedSWF(settings.uploader,settings.id+"Uploader",settings.width,settings.height,"9.0.24",settings.expressInstall,f,{quality:"high",wmode:settings.wmode,allowScriptAccess:settings.scriptAccess});if(settings.queueID==false){a("#"+a(this).attr("id")+"Uploader").after('<div id="'+a(this).attr("id")+'Queue" class="uploadifyQueue"></div>')}}if(typeof(settings.onOpen)=="function"){a(this).bind("uploadifyOpen",settings.onOpen)}a(this).bind("uploadifySelect",{action:settings.onSelect,queueID:settings.queueID},function(j,h,i){if(j.data.action(j,h,i)!==false){var k=Math.round(i.size/1024*100)*0.01;var l="KB";if(k>1000){k=Math.round(k*0.001*100)*0.01;l="MB"}var m=k.toString().split(".");if(m.length>1){k=m[0]+"."+m[1].substr(0,2)}else{k=m[0]}if(i.name.length>20){fileName=i.name.substr(0,20)+"..."}else{fileName=i.name}queue="#"+a(this).attr("id")+"Queue";if(j.data.queueID){queue="#"+j.data.queueID}a(queue).append('<div id="'+a(this).attr("id")+h+'" class="uploadifyQueueItem"><div class="cancel"><a href="javascript:jQuery(\'#'+a(this).attr("id")+"').uploadifyCancel('"+h+'\')"><img src="'+settings.cancelImg+'" border="0" /></a></div><span class="fileName">'+fileName+" ("+k+l+')</span><span class="percentage"></span><div class="uploadifyProgress"><div id="'+a(this).attr("id")+h+'ProgressBar" class="uploadifyProgressBar"><!--Progress Bar--></div></div></div>')}});if(typeof(settings.onSelectOnce)=="function"){a(this).bind("uploadifySelectOnce",settings.onSelectOnce)}a(this).bind("uploadifyQueueFull",{action:settings.onQueueFull},function(h,i){if(h.data.action(h,i)!==false){alert("The queue is full.  The max size is "+i+".")}});a(this).bind("uploadifyCheckExist",{action:settings.onCheck},function(m,l,k,j,o){var i=new Object();i=k;i.folder=e+j;if(o){for(var h in k){var n=h}}a.post(l,i,function(r){for(var p in r){if(m.data.action(m,l,k,j,o)!==false){var q=confirm("Do you want to replace the file "+r[p]+"?");if(!q){document.getElementById(a(m.target).attr("id")+"Uploader").cancelFileUpload(p,true,true)}}}if(o){document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(n,true)}else{document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(null,true)}},"json")});a(this).bind("uploadifyCancel",{action:settings.onCancel},function(l,h,k,m,j){if(l.data.action(l,h,k,m,j)!==false){var i=(j==true)?0:250;a("#"+a(this).attr("id")+h).fadeOut(i,function(){a(this).remove()})}});if(typeof(settings.onClearQueue)=="function"){a(this).bind("uploadifyClearQueue",settings.onClearQueue)}var c=[];a(this).bind("uploadifyError",{action:settings.onError},function(l,h,k,j){if(l.data.action(l,h,k,j)!==false){var i=new Array(h,k,j);c.push(i);a("#"+a(this).attr("id")+h+" .percentage").text(" - "+j.type+" Error");a("#"+a(this).attr("id")+h).addClass("uploadifyError")}});a(this).bind("uploadifyProgress",{action:settings.onProgress,toDisplay:settings.displayData},function(j,h,i,k){if(j.data.action(j,h,i,k)!==false){a("#"+a(this).attr("id")+h+"ProgressBar").css("width",k.percentage+"%");if(j.data.toDisplay=="percentage"){displayData=" - "+k.percentage+"%"}if(j.data.toDisplay=="speed"){displayData=" - "+k.speed+"KB/s"}if(j.data.toDisplay==null){displayData=" "}a("#"+a(this).attr("id")+h+" .percentage").text(displayData)}});a(this).bind("uploadifyComplete",{action:settings.onComplete},function(k,h,j,i,l){if(k.data.action(k,h,j,unescape(i),l)!==false){a("#"+a(this).attr("id")+h+" .percentage").text(" - Completed");a("#"+a(this).attr("id")+h).fadeOut(250,function(){a(this).remove()})}});if(typeof(settings.onAllComplete)=="function"){a(this).bind("uploadifyAllComplete",{action:settings.onAllComplete},function(h,i){if(h.data.action(h,i)!==false){c=[]}})}})},uploadifySettings:function(f,j,c){var g=false;a(this).each(function(){if(f=="scriptData"&&j!=null){if(c){var i=j}else{var i=a.extend(settings.scriptData,j)}var l="";for(var k in i){l+="&"+k+"="+escape(i[k])}j=l.substr(1)}g=document.getElementById(a(this).attr("id")+"Uploader").updateSettings(f,j)});if(j==null){if(f=="scriptData"){var b=unescape(g).split("&");var e=new Object();for(var d=0;d<b.length;d++){var h=b[d].split("=");e[h[0]]=h[1]}g=e}return g}},uploadifyUpload:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").startFileUpload(b,false)})},uploadifyCancel:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").cancelFileUpload(b,true,false)})},uploadifyClearQueue:function(){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").clearFileUploadQueue(false)})}})})(jQuery)};
\ No newline at end of file
index 8eafe9d..acc7da4 100644 (file)
@@ -1,4 +1,4 @@
-/*     SWFObject v2.2 <http://code.google.com/p/swfobject/> 
-       is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
+/*     SWFObject v2.2 <http://code.google.com/p/swfobject/>
+       is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
 */
 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}}}}();
\ No newline at end of file
index 9a78cd3..43c87be 100644 (file)
-/*\r
-Uploadify v2.1.0\r
-Release Date: August 24, 2009\r
-\r
-Copyright (c) 2009 Ronnie Garcia, Travis Nickels\r
-\r
-Permission is hereby granted, free of charge, to any person obtaining a copy\r
-of this software and associated documentation files (the "Software"), to deal\r
-in the Software without restriction, including without limitation the rights\r
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
-copies of the Software, and to permit persons to whom the Software is\r
-furnished to do so, subject to the following conditions:\r
-\r
-The above copyright notice and this permission notice shall be included in\r
-all copies or substantial portions of the Software.\r
-\r
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
-THE SOFTWARE.\r
-*/\r
-\r
-if(jQuery)(\r
-       function(jQuery){\r
-               jQuery.extend(jQuery.fn,{\r
-                       uploadify:function(options) {\r
-                               jQuery(this).each(function(){\r
-                                       settings = jQuery.extend({\r
-                                       id             : jQuery(this).attr('id'), // The ID of the object being Uploadified\r
-                                       uploader       : 'uploadify.swf', // The path to the uploadify swf file\r
-                                       script         : 'uploadify.php', // The path to the uploadify backend upload script\r
-                                       expressInstall : null, // The path to the express install swf file\r
-                                       folder         : '', // The path to the upload folder\r
-                                       height         : 30, // The height of the flash button\r
-                                       width          : 110, // The width of the flash button\r
-                                       cancelImg      : 'cancel.png', // The path to the cancel image for the default file queue item container\r
-                                       wmode          : 'opaque', // The wmode of the flash file\r
-                                       scriptAccess   : 'sameDomain', // Set to "always" to allow script access across domains\r
-                                       fileDataName   : 'Filedata', // The name of the file collection object in the backend upload script\r
-                                       method         : 'POST', // The method for sending variables to the backend upload script\r
-                                       queueSizeLimit : 999, // The maximum size of the file queue\r
-                                       simUploadLimit : 1, // The number of simultaneous uploads allowed\r
-                                       queueID        : false, // The optional ID of the queue container\r
-                                       displayData    : 'percentage', // Set to "speed" to show the upload speed in the default queue item\r
-                                       onInit         : function() {}, // Function to run when uploadify is initialized\r
-                                       onSelect       : function() {}, // Function to run when a file is selected\r
-                                       onQueueFull    : function() {}, // Function to run when the queue reaches capacity\r
-                                       onCheck        : function() {}, // Function to run when script checks for duplicate files on the server\r
-                                       onCancel       : function() {}, // Function to run when an item is cleared from the queue\r
-                                       onError        : function() {}, // Function to run when an upload item returns an error\r
-                                       onProgress     : function() {}, // Function to run each time the upload progress is updated\r
-                                       onComplete     : function() {}, // Function to run when an upload is completed\r
-                                       onAllComplete  : function() {}  // Functino to run when all uploads are completed\r
-                               }, options);\r
-                               var pagePath = location.pathname;\r
-                               pagePath = pagePath.split('/');\r
-                               pagePath.pop();\r
-                               pagePath = pagePath.join('/') + '/';\r
-                               var data = {};\r
-                               data.uploadifyID = settings.id;\r
-                               data.pagepath = pagePath;\r
-                               if (settings.buttonImg) data.buttonImg = escape(settings.buttonImg);\r
-                               if (settings.buttonText) data.buttonText = escape(settings.buttonText);\r
-                               if (settings.rollover) data.rollover = true;\r
-                               data.script = settings.script;\r
-                               data.folder = escape(settings.folder);\r
-                               if (settings.scriptData) {\r
-                                       var scriptDataString = '';\r
-                                       for (var name in settings.scriptData) {\r
-                                               scriptDataString += '&' + name + '=' + settings.scriptData[name];\r
-                                       }\r
-                                       data.scriptData = escape(scriptDataString.substr(1));\r
-                               }\r
-                               data.width          = settings.width;\r
-                               data.height         = settings.height;\r
-                               data.wmode          = settings.wmode;\r
-                               data.method         = settings.method;\r
-                               data.queueSizeLimit = settings.queueSizeLimit;\r
-                               data.simUploadLimit = settings.simUploadLimit;\r
-                               if (settings.hideButton)   data.hideButton   = true;\r
-                               if (settings.fileDesc)     data.fileDesc     = settings.fileDesc;\r
-                               if (settings.fileExt)      data.fileExt      = settings.fileExt;\r
-                               if (settings.multi)        data.multi        = true;\r
-                               if (settings.auto)         data.auto         = true;\r
-                               if (settings.sizeLimit)    data.sizeLimit    = settings.sizeLimit;\r
-                               if (settings.checkScript)  data.checkScript  = settings.checkScript;\r
-                               if (settings.fileDataName) data.fileDataName = settings.fileDataName;\r
-                               if (settings.queueID)      data.queueID      = settings.queueID;\r
-                               if (settings.onInit() !== false) {\r
-                                       jQuery(this).css('display','none');\r
-                                       jQuery(this).after('<div id="' + jQuery(this).attr('id') + 'Uploader"></div>');\r
-                                       swfobject.embedSWF(settings.uploader, settings.id + 'Uploader', settings.width, settings.height, '9.0.24', settings.expressInstall, data, {'quality':'high','wmode':settings.wmode,'allowScriptAccess':settings.scriptAccess});\r
-                                       if (settings.queueID == false) {\r
-                                               jQuery("#" + jQuery(this).attr('id') + "Uploader").after('<div id="' + jQuery(this).attr('id') + 'Queue" class="uploadifyQueue"></div>');\r
-                                       }\r
-                               }\r
-                               if (typeof(settings.onOpen) == 'function') {\r
-                                       jQuery(this).bind("uploadifyOpen", settings.onOpen);\r
-                               }\r
-                               jQuery(this).bind("uploadifySelect", {'action': settings.onSelect, 'queueID': settings.queueID}, function(event, ID, fileObj) {\r
-                                       if (event.data.action(event, ID, fileObj) !== false) {\r
-                                               var byteSize = Math.round(fileObj.size / 1024 * 100) * .01;\r
-                                               var suffix = 'KB';\r
-                                               if (byteSize > 1000) {\r
-                                                       byteSize = Math.round(byteSize *.001 * 100) * .01;\r
-                                                       suffix = 'MB';\r
-                                               }\r
-                                               var sizeParts = byteSize.toString().split('.');\r
-                                               if (sizeParts.length > 1) {\r
-                                                       byteSize = sizeParts[0] + '.' + sizeParts[1].substr(0,2);\r
-                                               } else {\r
-                                                       byteSize = sizeParts[0];\r
-                                               }\r
-                                               if (fileObj.name.length > 20) {\r
-                                                       fileName = fileObj.name.substr(0,20) + '...';\r
-                                               } else {\r
-                                                       fileName = fileObj.name;\r
-                                               }\r
-                                               queue = '#' + jQuery(this).attr('id') + 'Queue';\r
-                                               if (event.data.queueID) {\r
-                                                       queue = '#' + event.data.queueID;\r
-                                               }\r
-                                               jQuery(queue).append('<div id="' + jQuery(this).attr('id') + ID + '" class="uploadifyQueueItem">\\r
-                                                               <div class="cancel">\\r
-                                                                       <a href="javascript:jQuery(\'#' + jQuery(this).attr('id') + '\').uploadifyCancel(\'' + ID + '\')"><img src="' + settings.cancelImg + '" border="0" /></a>\\r
-                                                               </div>\\r
-                                                               <span class="fileName">' + fileName + ' (' + byteSize + suffix + ')</span><span class="percentage"></span>\\r
-                                                               <div class="uploadifyProgress">\\r
-                                                                       <div id="' + jQuery(this).attr('id') + ID + 'ProgressBar" class="uploadifyProgressBar"><!--Progress Bar--></div>\\r
-                                                               </div>\\r
-                                                       </div>');\r
-                                       }\r
-                               });\r
-                               if (typeof(settings.onSelectOnce) == 'function') {\r
-                                       jQuery(this).bind("uploadifySelectOnce", settings.onSelectOnce);\r
-                               }\r
-                               jQuery(this).bind("uploadifyQueueFull", {'action': settings.onQueueFull}, function(event, queueSizeLimit) {\r
-                                       if (event.data.action(event, queueSizeLimit) !== false) {\r
-                                               alert('The queue is full.  The max size is ' + queueSizeLimit + '.');\r
-                                       }\r
-                               });\r
-                               jQuery(this).bind("uploadifyCheckExist", {'action': settings.onCheck}, function(event, checkScript, fileQueueObj, folder, single) {\r
-                                       var postData = new Object();\r
-                                       postData = fileQueueObj;\r
-                                       postData.folder = pagePath + folder;\r
-                                       if (single) {\r
-                                               for (var ID in fileQueueObj) {\r
-                                                       var singleFileID = ID;\r
-                                               }\r
-                                       }\r
-                                       jQuery.post(checkScript, postData, function(data) {\r
-                                               for(var key in data) {\r
-                                                       if (event.data.action(event, checkScript, fileQueueObj, folder, single) !== false) {\r
-                                                               var replaceFile = confirm("Do you want to replace the file " + data[key] + "?");\r
-                                                               if (!replaceFile) {\r
-                                                                       document.getElementById(jQuery(event.target).attr('id') + 'Uploader').cancelFileUpload(key, true,true);\r
-                                                               }\r
-                                                       }\r
-                                               }\r
-                                               if (single) {\r
-                                                       document.getElementById(jQuery(event.target).attr('id') + 'Uploader').startFileUpload(singleFileID, true);\r
-                                               } else {\r
-                                                       document.getElementById(jQuery(event.target).attr('id') + 'Uploader').startFileUpload(null, true);\r
-                                               }\r
-                                       }, "json");\r
-                               });\r
-                               jQuery(this).bind("uploadifyCancel", {'action': settings.onCancel}, function(event, ID, fileObj, data, clearFast) {\r
-                                       if (event.data.action(event, ID, fileObj, data, clearFast) !== false) {\r
-                                               var fadeSpeed = (clearFast == true) ? 0 : 250;\r
-                                               jQuery("#" + jQuery(this).attr('id') + ID).fadeOut(fadeSpeed, function() { jQuery(this).remove() });\r
-                                       }\r
-                               });\r
-                               if (typeof(settings.onClearQueue) == 'function') {\r
-                                       jQuery(this).bind("uploadifyClearQueue", settings.onClearQueue);\r
-                               }\r
-                               var errorArray = [];\r
-                               jQuery(this).bind("uploadifyError", {'action': settings.onError}, function(event, ID, fileObj, errorObj) {\r
-                                       if (event.data.action(event, ID, fileObj, errorObj) !== false) {\r
-                                               var fileArray = new Array(ID, fileObj, errorObj);\r
-                                               errorArray.push(fileArray);\r
-                                               jQuery("#" + jQuery(this).attr('id') + ID + " .percentage").text(" - " + errorObj.type + " Error");\r
-                                               jQuery("#" + jQuery(this).attr('id') + ID).addClass('uploadifyError');\r
-                                       }\r
-                               });\r
-                               jQuery(this).bind("uploadifyProgress", {'action': settings.onProgress, 'toDisplay': settings.displayData}, function(event, ID, fileObj, data) {\r
-                                       if (event.data.action(event, ID, fileObj, data) !== false) {\r
-                                               jQuery("#" + jQuery(this).attr('id') + ID + "ProgressBar").css('width', data.percentage + '%');\r
-                                               if (event.data.toDisplay == 'percentage') displayData = ' - ' + data.percentage + '%';\r
-                                               if (event.data.toDisplay == 'speed') displayData = ' - ' + data.speed + 'KB/s';\r
-                                               if (event.data.toDisplay == null) displayData = ' ';\r
-                                               jQuery("#" + jQuery(this).attr('id') + ID + " .percentage").text(displayData);\r
-                                       }\r
-                               });\r
-                               jQuery(this).bind("uploadifyComplete", {'action': settings.onComplete}, function(event, ID, fileObj, response, data) {\r
-                                       if (event.data.action(event, ID, fileObj, unescape(response), data) !== false) {\r
-                                               jQuery("#" + jQuery(this).attr('id') + ID + " .percentage").text(' - Completed');\r
-                                               jQuery("#" + jQuery(this).attr('id') + ID).fadeOut(250, function() { jQuery(this).remove()});\r
-                                       }\r
-                               });\r
-                               if (typeof(settings.onAllComplete) == 'function') {\r
-                                       jQuery(this).bind("uploadifyAllComplete", {'action': settings.onAllComplete}, function(event, uploadObj) {\r
-                                               if (event.data.action(event, uploadObj) !== false) {\r
-                                                       errorArray = [];\r
-                                               }\r
-                                       });\r
-                               }\r
-                       });\r
-               },\r
-               uploadifySettings:function(settingName, settingValue, resetObject) {\r
-                       var returnValue = false;\r
-                       jQuery(this).each(function() {\r
-                               if (settingName == 'scriptData' && settingValue != null) {\r
-                                       if (resetObject) {\r
-                                               var scriptData = settingValue;\r
-                                       } else {\r
-                                               var scriptData = jQuery.extend(settings.scriptData, settingValue);\r
-                                       }\r
-                                       var scriptDataString = '';\r
-                                       for (var name in scriptData) {\r
-                                               scriptDataString += '&' + name + '=' + escape(scriptData[name]);\r
-                                       }\r
-                                       settingValue = scriptDataString.substr(1);\r
-                               }\r
-                               returnValue = document.getElementById(jQuery(this).attr('id') + 'Uploader').updateSettings(settingName, settingValue);\r
-                       });\r
-                       if (settingValue == null) {\r
-                               if (settingName == 'scriptData') {\r
-                                       var returnSplit = unescape(returnValue).split('&');\r
-                                       var returnObj   = new Object();\r
-                                       for (var i = 0; i < returnSplit.length; i++) {\r
-                                               var iSplit = returnSplit[i].split('=');\r
-                                               returnObj[iSplit[0]] = iSplit[1];\r
-                                       }\r
-                                       returnValue = returnObj;\r
-                               }\r
-                               return returnValue;\r
-                       }\r
-               },\r
-               uploadifyUpload:function(ID) {\r
-                       jQuery(this).each(function() {\r
-                               document.getElementById(jQuery(this).attr('id') + 'Uploader').startFileUpload(ID, false);\r
-                       });\r
-               },\r
-               uploadifyCancel:function(ID) {\r
-                       jQuery(this).each(function() {\r
-                               document.getElementById(jQuery(this).attr('id') + 'Uploader').cancelFileUpload(ID, true, false);\r
-                       });\r
-               },\r
-               uploadifyClearQueue:function() {\r
-                       jQuery(this).each(function() {\r
-                               document.getElementById(jQuery(this).attr('id') + 'Uploader').clearFileUploadQueue(false);\r
-                       });\r
-               }\r
-       })\r
+/*
+Uploadify v2.1.0
+Release Date: August 24, 2009
+
+Copyright (c) 2009 Ronnie Garcia, Travis Nickels
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
+if(jQuery)(
+       function(jQuery){
+               jQuery.extend(jQuery.fn,{
+                       uploadify:function(options) {
+                               jQuery(this).each(function(){
+                                       settings = jQuery.extend({
+                                       id             : jQuery(this).attr('id'), // The ID of the object being Uploadified
+                                       uploader       : 'uploadify.swf', // The path to the uploadify swf file
+                                       script         : 'uploadify.php', // The path to the uploadify backend upload script
+                                       expressInstall : null, // The path to the express install swf file
+                                       folder         : '', // The path to the upload folder
+                                       height         : 30, // The height of the flash button
+                                       width          : 110, // The width of the flash button
+                                       cancelImg      : 'cancel.png', // The path to the cancel image for the default file queue item container
+                                       wmode          : 'opaque', // The wmode of the flash file
+                                       scriptAccess   : 'sameDomain', // Set to "always" to allow script access across domains
+                                       fileDataName   : 'Filedata', // The name of the file collection object in the backend upload script
+                                       method         : 'POST', // The method for sending variables to the backend upload script
+                                       queueSizeLimit : 999, // The maximum size of the file queue
+                                       simUploadLimit : 1, // The number of simultaneous uploads allowed
+                                       queueID        : false, // The optional ID of the queue container
+                                       displayData    : 'percentage', // Set to "speed" to show the upload speed in the default queue item
+                                       onInit         : function() {}, // Function to run when uploadify is initialized
+                                       onSelect       : function() {}, // Function to run when a file is selected
+                                       onQueueFull    : function() {}, // Function to run when the queue reaches capacity
+                                       onCheck        : function() {}, // Function to run when script checks for duplicate files on the server
+                                       onCancel       : function() {}, // Function to run when an item is cleared from the queue
+                                       onError        : function() {}, // Function to run when an upload item returns an error
+                                       onProgress     : function() {}, // Function to run each time the upload progress is updated
+                                       onComplete     : function() {}, // Function to run when an upload is completed
+                                       onAllComplete  : function() {}  // Functino to run when all uploads are completed
+                               }, options);
+                               var pagePath = location.pathname;
+                               pagePath = pagePath.split('/');
+                               pagePath.pop();
+                               pagePath = pagePath.join('/') + '/';
+                               var data = {};
+                               data.uploadifyID = settings.id;
+                               data.pagepath = pagePath;
+                               if (settings.buttonImg) data.buttonImg = escape(settings.buttonImg);
+                               if (settings.buttonText) data.buttonText = escape(settings.buttonText);
+                               if (settings.rollover) data.rollover = true;
+                               data.script = settings.script;
+                               data.folder = escape(settings.folder);
+                               if (settings.scriptData) {
+                                       var scriptDataString = '';
+                                       for (var name in settings.scriptData) {
+                                               scriptDataString += '&' + name + '=' + settings.scriptData[name];
+                                       }
+                                       data.scriptData = escape(scriptDataString.substr(1));
+                               }
+                               data.width          = settings.width;
+                               data.height         = settings.height;
+                               data.wmode          = settings.wmode;
+                               data.method         = settings.method;
+                               data.queueSizeLimit = settings.queueSizeLimit;
+                               data.simUploadLimit = settings.simUploadLimit;
+                               if (settings.hideButton)   data.hideButton   = true;
+                               if (settings.fileDesc)     data.fileDesc     = settings.fileDesc;
+                               if (settings.fileExt)      data.fileExt      = settings.fileExt;
+                               if (settings.multi)        data.multi        = true;
+                               if (settings.auto)         data.auto         = true;
+                               if (settings.sizeLimit)    data.sizeLimit    = settings.sizeLimit;
+                               if (settings.checkScript)  data.checkScript  = settings.checkScript;
+                               if (settings.fileDataName) data.fileDataName = settings.fileDataName;
+                               if (settings.queueID)      data.queueID      = settings.queueID;
+                               if (settings.onInit() !== false) {
+                                       jQuery(this).css('display','none');
+                                       jQuery(this).after('<div id="' + jQuery(this).attr('id') + 'Uploader"></div>');
+                                       swfobject.embedSWF(settings.uploader, settings.id + 'Uploader', settings.width, settings.height, '9.0.24', settings.expressInstall, data, {'quality':'high','wmode':settings.wmode,'allowScriptAccess':settings.scriptAccess});
+                                       if (settings.queueID == false) {
+                                               jQuery("#" + jQuery(this).attr('id') + "Uploader").after('<div id="' + jQuery(this).attr('id') + 'Queue" class="uploadifyQueue"></div>');
+                                       }
+                               }
+                               if (typeof(settings.onOpen) == 'function') {
+                                       jQuery(this).bind("uploadifyOpen", settings.onOpen);
+                               }
+                               jQuery(this).bind("uploadifySelect", {'action': settings.onSelect, 'queueID': settings.queueID}, function(event, ID, fileObj) {
+                                       if (event.data.action(event, ID, fileObj) !== false) {
+                                               var byteSize = Math.round(fileObj.size / 1024 * 100) * .01;
+                                               var suffix = 'KB';
+                                               if (byteSize > 1000) {
+                                                       byteSize = Math.round(byteSize *.001 * 100) * .01;
+                                                       suffix = 'MB';
+                                               }
+                                               var sizeParts = byteSize.toString().split('.');
+                                               if (sizeParts.length > 1) {
+                                                       byteSize = sizeParts[0] + '.' + sizeParts[1].substr(0,2);
+                                               } else {
+                                                       byteSize = sizeParts[0];
+                                               }
+                                               if (fileObj.name.length > 20) {
+                                                       fileName = fileObj.name.substr(0,20) + '...';
+                                               } else {
+                                                       fileName = fileObj.name;
+                                               }
+                                               queue = '#' + jQuery(this).attr('id') + 'Queue';
+                                               if (event.data.queueID) {
+                                                       queue = '#' + event.data.queueID;
+                                               }
+                                               jQuery(queue).append('<div id="' + jQuery(this).attr('id') + ID + '" class="uploadifyQueueItem">\
+                                                               <div class="cancel">\
+                                                                       <a href="javascript:jQuery(\'#' + jQuery(this).attr('id') + '\').uploadifyCancel(\'' + ID + '\')"><img src="' + settings.cancelImg + '" border="0" /></a>\
+                                                               </div>\
+                                                               <span class="fileName">' + fileName + ' (' + byteSize + suffix + ')</span><span class="percentage"></span>\
+                                                               <div class="uploadifyProgress">\
+                                                                       <div id="' + jQuery(this).attr('id') + ID + 'ProgressBar" class="uploadifyProgressBar"><!--Progress Bar--></div>\
+                                                               </div>\
+                                                       </div>');
+                                       }
+                               });
+                               if (typeof(settings.onSelectOnce) == 'function') {
+                                       jQuery(this).bind("uploadifySelectOnce", settings.onSelectOnce);
+                               }
+                               jQuery(this).bind("uploadifyQueueFull", {'action': settings.onQueueFull}, function(event, queueSizeLimit) {
+                                       if (event.data.action(event, queueSizeLimit) !== false) {
+                                               alert('The queue is full.  The max size is ' + queueSizeLimit + '.');
+                                       }
+                               });
+                               jQuery(this).bind("uploadifyCheckExist", {'action': settings.onCheck}, function(event, checkScript, fileQueueObj, folder, single) {
+                                       var postData = new Object();
+                                       postData = fileQueueObj;
+                                       postData.folder = pagePath + folder;
+                                       if (single) {
+                                               for (var ID in fileQueueObj) {
+                                                       var singleFileID = ID;
+                                               }
+                                       }
+                                       jQuery.post(checkScript, postData, function(data) {
+                                               for(var key in data) {
+                                                       if (event.data.action(event, checkScript, fileQueueObj, folder, single) !== false) {
+                                                               var replaceFile = confirm("Do you want to replace the file " + data[key] + "?");
+                                                               if (!replaceFile) {
+                                                                       document.getElementById(jQuery(event.target).attr('id') + 'Uploader').cancelFileUpload(key, true,true);
+                                                               }
+                                                       }
+                                               }
+                                               if (single) {
+                                                       document.getElementById(jQuery(event.target).attr('id') + 'Uploader').startFileUpload(singleFileID, true);
+                                               } else {
+                                                       document.getElementById(jQuery(event.target).attr('id') + 'Uploader').startFileUpload(null, true);
+                                               }
+                                       }, "json");
+                               });
+                               jQuery(this).bind("uploadifyCancel", {'action': settings.onCancel}, function(event, ID, fileObj, data, clearFast) {
+                                       if (event.data.action(event, ID, fileObj, data, clearFast) !== false) {
+                                               var fadeSpeed = (clearFast == true) ? 0 : 250;
+                                               jQuery("#" + jQuery(this).attr('id') + ID).fadeOut(fadeSpeed, function() { jQuery(this).remove() });
+                                       }
+                               });
+                               if (typeof(settings.onClearQueue) == 'function') {
+                                       jQuery(this).bind("uploadifyClearQueue", settings.onClearQueue);
+                               }
+                               var errorArray = [];
+                               jQuery(this).bind("uploadifyError", {'action': settings.onError}, function(event, ID, fileObj, errorObj) {
+                                       if (event.data.action(event, ID, fileObj, errorObj) !== false) {
+                                               var fileArray = new Array(ID, fileObj, errorObj);
+                                               errorArray.push(fileArray);
+                                               jQuery("#" + jQuery(this).attr('id') + ID + " .percentage").text(" - " + errorObj.type + " Error");
+                                               jQuery("#" + jQuery(this).attr('id') + ID).addClass('uploadifyError');
+                                       }
+                               });
+                               jQuery(this).bind("uploadifyProgress", {'action': settings.onProgress, 'toDisplay': settings.displayData}, function(event, ID, fileObj, data) {
+                                       if (event.data.action(event, ID, fileObj, data) !== false) {
+                                               jQuery("#" + jQuery(this).attr('id') + ID + "ProgressBar").css('width', data.percentage + '%');
+                                               if (event.data.toDisplay == 'percentage') displayData = ' - ' + data.percentage + '%';
+                                               if (event.data.toDisplay == 'speed') displayData = ' - ' + data.speed + 'KB/s';
+                                               if (event.data.toDisplay == null) displayData = ' ';
+                                               jQuery("#" + jQuery(this).attr('id') + ID + " .percentage").text(displayData);
+                                       }
+                               });
+                               jQuery(this).bind("uploadifyComplete", {'action': settings.onComplete}, function(event, ID, fileObj, response, data) {
+                                       if (event.data.action(event, ID, fileObj, unescape(response), data) !== false) {
+                                               jQuery("#" + jQuery(this).attr('id') + ID + " .percentage").text(' - Completed');
+                                               jQuery("#" + jQuery(this).attr('id') + ID).fadeOut(250, function() { jQuery(this).remove()});
+                                       }
+                               });
+                               if (typeof(settings.onAllComplete) == 'function') {
+                                       jQuery(this).bind("uploadifyAllComplete", {'action': settings.onAllComplete}, function(event, uploadObj) {
+                                               if (event.data.action(event, uploadObj) !== false) {
+                                                       errorArray = [];
+                                               }
+                                       });
+                               }
+                       });
+               },
+               uploadifySettings:function(settingName, settingValue, resetObject) {
+                       var returnValue = false;
+                       jQuery(this).each(function() {
+                               if (settingName == 'scriptData' && settingValue != null) {
+                                       if (resetObject) {
+                                               var scriptData = settingValue;
+                                       } else {
+                                               var scriptData = jQuery.extend(settings.scriptData, settingValue);
+                                       }
+                                       var scriptDataString = '';
+                                       for (var name in scriptData) {
+                                               scriptDataString += '&' + name + '=' + escape(scriptData[name]);
+                                       }
+                                       settingValue = scriptDataString.substr(1);
+                               }
+                               returnValue = document.getElementById(jQuery(this).attr('id') + 'Uploader').updateSettings(settingName, settingValue);
+                       });
+                       if (settingValue == null) {
+                               if (settingName == 'scriptData') {
+                                       var returnSplit = unescape(returnValue).split('&');
+                                       var returnObj   = new Object();
+                                       for (var i = 0; i < returnSplit.length; i++) {
+                                               var iSplit = returnSplit[i].split('=');
+                                               returnObj[iSplit[0]] = iSplit[1];
+                                       }
+                                       returnValue = returnObj;
+                               }
+                               return returnValue;
+                       }
+               },
+               uploadifyUpload:function(ID) {
+                       jQuery(this).each(function() {
+                               document.getElementById(jQuery(this).attr('id') + 'Uploader').startFileUpload(ID, false);
+                       });
+               },
+               uploadifyCancel:function(ID) {
+                       jQuery(this).each(function() {
+                               document.getElementById(jQuery(this).attr('id') + 'Uploader').cancelFileUpload(ID, true, false);
+                       });
+               },
+               uploadifyClearQueue:function() {
+                       jQuery(this).each(function() {
+                               document.getElementById(jQuery(this).attr('id') + 'Uploader').clearFileUploadQueue(false);
+                       });
+               }
+       })
 })(jQuery);
\ No newline at end of file
index 04592ff..4305311 100644 (file)
@@ -1,26 +1,26 @@
-/*\r
-Uploadify v2.1.0\r
-Release Date: August 24, 2009\r
-\r
-Copyright (c) 2009 Ronnie Garcia, Travis Nickels\r
-\r
-Permission is hereby granted, free of charge, to any person obtaining a copy\r
-of this software and associated documentation files (the "Software"), to deal\r
-in the Software without restriction, including without limitation the rights\r
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
-copies of the Software, and to permit persons to whom the Software is\r
-furnished to do so, subject to the following conditions:\r
-\r
-The above copyright notice and this permission notice shall be included in\r
-all copies or substantial portions of the Software.\r
-\r
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
-THE SOFTWARE.\r
-*/\r
-\r
+/*
+Uploadify v2.1.0
+Release Date: August 24, 2009
+
+Copyright (c) 2009 Ronnie Garcia, Travis Nickels
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
 if(jQuery){(function(a){a.extend(a.fn,{uploadify:function(b){a(this).each(function(){settings=a.extend({id:a(this).attr("id"),uploader:"uploadify.swf",script:"uploadify.php",expressInstall:null,folder:"",height:30,width:110,cancelImg:"cancel.png",wmode:"opaque",scriptAccess:"sameDomain",fileDataName:"Filedata",method:"POST",queueSizeLimit:999,simUploadLimit:1,queueID:false,displayData:"percentage",onInit:function(){},onSelect:function(){},onQueueFull:function(){},onCheck:function(){},onCancel:function(){},onError:function(){},onProgress:function(){},onComplete:function(){},onAllComplete:function(){}},b);var e=location.pathname;e=e.split("/");e.pop();e=e.join("/")+"/";var f={};f.uploadifyID=settings.id;f.pagepath=e;if(settings.buttonImg){f.buttonImg=escape(settings.buttonImg)}if(settings.buttonText){f.buttonText=escape(settings.buttonText)}if(settings.rollover){f.rollover=true}f.script=settings.script;f.folder=escape(settings.folder);if(settings.scriptData){var g="";for(var d in settings.scriptData){g+="&"+d+"="+settings.scriptData[d]}f.scriptData=escape(g.substr(1))}f.width=settings.width;f.height=settings.height;f.wmode=settings.wmode;f.method=settings.method;f.queueSizeLimit=settings.queueSizeLimit;f.simUploadLimit=settings.simUploadLimit;if(settings.hideButton){f.hideButton=true}if(settings.fileDesc){f.fileDesc=settings.fileDesc}if(settings.fileExt){f.fileExt=settings.fileExt}if(settings.multi){f.multi=true}if(settings.auto){f.auto=true}if(settings.sizeLimit){f.sizeLimit=settings.sizeLimit}if(settings.checkScript){f.checkScript=settings.checkScript}if(settings.fileDataName){f.fileDataName=settings.fileDataName}if(settings.queueID){f.queueID=settings.queueID}if(settings.onInit()!==false){a(this).css("display","none");a(this).after('<div id="'+a(this).attr("id")+'Uploader"></div>');swfobject.embedSWF(settings.uploader,settings.id+"Uploader",settings.width,settings.height,"9.0.24",settings.expressInstall,f,{quality:"high",wmode:settings.wmode,allowScriptAccess:settings.scriptAccess});if(settings.queueID==false){a("#"+a(this).attr("id")+"Uploader").after('<div id="'+a(this).attr("id")+'Queue" class="uploadifyQueue"></div>')}}if(typeof(settings.onOpen)=="function"){a(this).bind("uploadifyOpen",settings.onOpen)}a(this).bind("uploadifySelect",{action:settings.onSelect,queueID:settings.queueID},function(j,h,i){if(j.data.action(j,h,i)!==false){var k=Math.round(i.size/1024*100)*0.01;var l="KB";if(k>1000){k=Math.round(k*0.001*100)*0.01;l="MB"}var m=k.toString().split(".");if(m.length>1){k=m[0]+"."+m[1].substr(0,2)}else{k=m[0]}if(i.name.length>20){fileName=i.name.substr(0,20)+"..."}else{fileName=i.name}queue="#"+a(this).attr("id")+"Queue";if(j.data.queueID){queue="#"+j.data.queueID}a(queue).append('<div id="'+a(this).attr("id")+h+'" class="uploadifyQueueItem"><div class="cancel"><a href="javascript:jQuery(\'#'+a(this).attr("id")+"').uploadifyCancel('"+h+'\')"><img src="'+settings.cancelImg+'" border="0" /></a></div><span class="fileName">'+fileName+" ("+k+l+')</span><span class="percentage"></span><div class="uploadifyProgress"><div id="'+a(this).attr("id")+h+'ProgressBar" class="uploadifyProgressBar"><!--Progress Bar--></div></div></div>')}});if(typeof(settings.onSelectOnce)=="function"){a(this).bind("uploadifySelectOnce",settings.onSelectOnce)}a(this).bind("uploadifyQueueFull",{action:settings.onQueueFull},function(h,i){if(h.data.action(h,i)!==false){alert("The queue is full.  The max size is "+i+".")}});a(this).bind("uploadifyCheckExist",{action:settings.onCheck},function(m,l,k,j,o){var i=new Object();i=k;i.folder=e+j;if(o){for(var h in k){var n=h}}a.post(l,i,function(r){for(var p in r){if(m.data.action(m,l,k,j,o)!==false){var q=confirm("Do you want to replace the file "+r[p]+"?");if(!q){document.getElementById(a(m.target).attr("id")+"Uploader").cancelFileUpload(p,true,true)}}}if(o){document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(n,true)}else{document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(null,true)}},"json")});a(this).bind("uploadifyCancel",{action:settings.onCancel},function(l,h,k,m,j){if(l.data.action(l,h,k,m,j)!==false){var i=(j==true)?0:250;a("#"+a(this).attr("id")+h).fadeOut(i,function(){a(this).remove()})}});if(typeof(settings.onClearQueue)=="function"){a(this).bind("uploadifyClearQueue",settings.onClearQueue)}var c=[];a(this).bind("uploadifyError",{action:settings.onError},function(l,h,k,j){if(l.data.action(l,h,k,j)!==false){var i=new Array(h,k,j);c.push(i);a("#"+a(this).attr("id")+h+" .percentage").text(" - "+j.type+" Error");a("#"+a(this).attr("id")+h).addClass("uploadifyError")}});a(this).bind("uploadifyProgress",{action:settings.onProgress,toDisplay:settings.displayData},function(j,h,i,k){if(j.data.action(j,h,i,k)!==false){a("#"+a(this).attr("id")+h+"ProgressBar").css("width",k.percentage+"%");if(j.data.toDisplay=="percentage"){displayData=" - "+k.percentage+"%"}if(j.data.toDisplay=="speed"){displayData=" - "+k.speed+"KB/s"}if(j.data.toDisplay==null){displayData=" "}a("#"+a(this).attr("id")+h+" .percentage").text(displayData)}});a(this).bind("uploadifyComplete",{action:settings.onComplete},function(k,h,j,i,l){if(k.data.action(k,h,j,unescape(i),l)!==false){a("#"+a(this).attr("id")+h+" .percentage").text(" - Completed");a("#"+a(this).attr("id")+h).fadeOut(250,function(){a(this).remove()})}});if(typeof(settings.onAllComplete)=="function"){a(this).bind("uploadifyAllComplete",{action:settings.onAllComplete},function(h,i){if(h.data.action(h,i)!==false){c=[]}})}})},uploadifySettings:function(f,j,c){var g=false;a(this).each(function(){if(f=="scriptData"&&j!=null){if(c){var i=j}else{var i=a.extend(settings.scriptData,j)}var l="";for(var k in i){l+="&"+k+"="+escape(i[k])}j=l.substr(1)}g=document.getElementById(a(this).attr("id")+"Uploader").updateSettings(f,j)});if(j==null){if(f=="scriptData"){var b=unescape(g).split("&");var e=new Object();for(var d=0;d<b.length;d++){var h=b[d].split("=");e[h[0]]=h[1]}g=e}return g}},uploadifyUpload:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").startFileUpload(b,false)})},uploadifyCancel:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").cancelFileUpload(b,true,false)})},uploadifyClearQueue:function(){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").clearFileUploadQueue(false)})}})})(jQuery)};
\ No newline at end of file
index 8eafe9d..acc7da4 100644 (file)
@@ -1,4 +1,4 @@
-/*     SWFObject v2.2 <http://code.google.com/p/swfobject/> 
-       is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
+/*     SWFObject v2.2 <http://code.google.com/p/swfobject/>
+       is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
 */
 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}}}}();
\ No newline at end of file
index 688a979..5c08b05 100644 (file)
Binary files a/platforma/static/icons/close.png and b/platforma/static/icons/close.png differ
index fe1c4ec..a208ca1 100644 (file)
@@ -1,21 +1,21 @@
 (function() {
   var slice = Array.prototype.slice;
-  
+
   function update(array, args) {
     var arrayLength = array.length, length = args.length;
     while (length--) array[arrayLength + length] = args[length];
     return array;
   };
-  
+
   function merge(array, args) {
     array = slice.call(array, 0);
     return update(array, args);
   };
-  
+
   Function.prototype.bind = function(context) {
     if (arguments.length < 2 && typeof arguments[0] === 'undefined') {
       return this;
-    } 
+    }
     var __method = this;
     var args = slice.call(arguments, 1);
     return function() {
@@ -23,7 +23,7 @@
       return __method.apply(context, a);
     }
   }
-  
+
 })();
 
 
@@ -169,7 +169,7 @@ function ScriptletCenter()
         else if(ucase != text) repl = lcase; /* neither lower- or upper-case */
         else { /* upper case -> camel-case */
             var words = $(lcase.split(/\s/)).map(function() {
-                if(this.length > 0) { 
+                if(this.length > 0) {
                     return this[0].toUpperCase() + this.slice(1);
                 } else {
                     return '';
@@ -208,7 +208,7 @@ function ScriptletCenter()
         if (!text) {
             this.XMLEditorMoveCursorForward(context, params.tag.length + 2);
         }
-        
+
     }.bind(this);
 
 }
index 9d12a29..0d25ba6 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 ;(function($) {
-       
+
 $.fn.extend({
        autocomplete: function(urlOrData, options) {
                var isUrl = typeof urlOrData == "string";
@@ -21,13 +21,13 @@ $.fn.extend({
                        delay: isUrl ? $.Autocompleter.defaults.delay : 10,
                        max: options && !options.scroll ? 10 : 150
                }, options);
-               
+
                // if highlight is set to false, replace it with a do-nothing function
                options.highlight = options.highlight || function(value) { return value; };
-               
+
                // if the formatMatch option is not specified, then use formatItem for backwards compatibility
                options.formatMatch = options.formatMatch || options.formatItem;
-               
+
                return this.each(function() {
                        new $.Autocompleter(this, options);
                });
@@ -76,9 +76,9 @@ $.Autocompleter = function(input, options) {
                mouseDownOnSelect: false
        };
        var select = $.Autocompleter.Select(options, input, selectCurrent, config);
-       
+
        var blockSubmit;
-       
+
        // prevent form submit in opera when selecting with return key
        $.browser.opera && $(input.form).bind("submit.autocomplete", function() {
                if (blockSubmit) {
@@ -86,7 +86,7 @@ $.Autocompleter = function(input, options) {
                        return false;
                }
        });
-       
+
        // only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all
        $input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) {
                // a keypress means the input has focus
@@ -95,7 +95,7 @@ $.Autocompleter = function(input, options) {
                // track last key pressed
                lastKeyPressCode = event.keyCode;
                switch(event.keyCode) {
-               
+
                        case KEY.UP:
                                event.preventDefault();
                                if ( select.visible() ) {
@@ -104,7 +104,7 @@ $.Autocompleter = function(input, options) {
                                        onChange(0, true);
                                }
                                break;
-                               
+
                        case KEY.DOWN:
                                event.preventDefault();
                                if ( select.visible() ) {
@@ -113,7 +113,7 @@ $.Autocompleter = function(input, options) {
                                        onChange(0, true);
                                }
                                break;
-                               
+
                        case KEY.PAGEUP:
                                event.preventDefault();
                                if ( select.visible() ) {
@@ -122,7 +122,7 @@ $.Autocompleter = function(input, options) {
                                        onChange(0, true);
                                }
                                break;
-                               
+
                        case KEY.PAGEDOWN:
                                event.preventDefault();
                                if ( select.visible() ) {
@@ -131,7 +131,7 @@ $.Autocompleter = function(input, options) {
                                        onChange(0, true);
                                }
                                break;
-                       
+
                        // matches also semicolon
                        case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
                        case KEY.TAB:
@@ -143,11 +143,11 @@ $.Autocompleter = function(input, options) {
                                        return false;
                                }
                                break;
-                               
+
                        case KEY.ESC:
                                select.hide();
                                break;
-                               
+
                        default:
                                clearTimeout(timeout);
                                timeout = setTimeout(onChange, options.delay);
@@ -198,16 +198,16 @@ $.Autocompleter = function(input, options) {
                $input.unbind();
                $(input.form).unbind(".autocomplete");
        });
-       
-       
+
+
        function selectCurrent() {
                var selected = select.selected();
                if( !selected )
                        return false;
-               
+
                var v = selected.result;
                previousValue = v;
-               
+
                if ( options.multiple ) {
                        var words = trimWords($input.val());
                        if ( words.length > 1 ) {
@@ -229,26 +229,26 @@ $.Autocompleter = function(input, options) {
                        }
                        v += options.multipleSeparator;
                }
-               
+
                $input.val(v);
                hideResultsNow();
                $input.trigger("result", [selected.data, selected.value]);
                return true;
        }
-       
+
        function onChange(crap, skipPrevCheck) {
                if( lastKeyPressCode == KEY.DEL ) {
                        select.hide();
                        return;
                }
-               
+
                var currentValue = $input.val();
-               
+
                if ( !skipPrevCheck && currentValue == previousValue )
                        return;
-               
+
                previousValue = currentValue;
-               
+
                currentValue = lastWord(currentValue);
                if ( currentValue.length >= options.minChars) {
                        $input.addClass(options.loadingClass);
@@ -260,7 +260,7 @@ $.Autocompleter = function(input, options) {
                        select.hide();
                }
        };
-       
+
        function trimWords(value) {
                if (!value)
                        return [""];
@@ -270,12 +270,12 @@ $.Autocompleter = function(input, options) {
                        return $.trim(value).length ? $.trim(word) : null;
                });
        }
-       
+
        function lastWord(value) {
                if ( !options.multiple )
                        return value;
                var words = trimWords(value);
-               if (words.length == 1) 
+               if (words.length == 1)
                        return words[0];
                var cursorAt = $(input).selection().start;
                if (cursorAt == value.length) {
@@ -285,7 +285,7 @@ $.Autocompleter = function(input, options) {
                }
                return words[words.length - 1];
        }
-       
+
        // fills in the input box w/the first match (assumed to be the best match)
        // q: the term entered
        // sValue: the first matching result
@@ -350,14 +350,14 @@ $.Autocompleter = function(input, options) {
                        success(term, data);
                // if an AJAX url has been supplied, try loading the data now
                } else if( (typeof options.url == "string") && (options.url.length > 0) ){
-                       
+
                        var extraParams = {
                                timestamp: +new Date()
                        };
                        $.each(options.extraParams, function(key, param) {
                                extraParams[key] = typeof param == "function" ? param() : param;
                        });
-                       
+
                        $.ajax({
                                // try to leverage ajaxQueue plugin to abort previous requests
                                mode: "abort",
@@ -381,7 +381,7 @@ $.Autocompleter = function(input, options) {
                        failure(term);
                }
        };
-       
+
        function parse(data) {
                var parsed = [];
                var rows = data.split("\n");
@@ -436,9 +436,9 @@ $.Autocompleter.Cache = function(options) {
 
        var data = {};
        var length = 0;
-       
+
        function matchSubset(s, sub) {
-               if (!options.matchCase) 
+               if (!options.matchCase)
                        s = s.toLowerCase();
                var i = s.indexOf(sub);
                if (options.matchContains == "word"){
@@ -447,17 +447,17 @@ $.Autocompleter.Cache = function(options) {
                if (i == -1) return false;
                return i == 0 || options.matchContains;
        };
-       
+
        function add(q, value) {
                if (length > options.cacheLength){
                        flush();
                }
-               if (!data[q]){ 
+               if (!data[q]){
                        length++;
                }
                data[q] = value;
        }
-       
+
        function populate(){
                if( !options.data ) return false;
                // track the matches
@@ -466,23 +466,23 @@ $.Autocompleter.Cache = function(options) {
 
                // no url was specified, we need to adjust the cache length to make sure it fits the local data store
                if( !options.url ) options.cacheLength = 1;
-               
+
                // track all options for minChars = 0
                stMatchSets[""] = [];
-               
+
                // loop through the array and create a lookup structure
                for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
                        var rawValue = options.data[i];
                        // if rawValue is a string, make an array otherwise just reference the array
                        rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;
-                       
+
                        var value = options.formatMatch(rawValue, i+1, options.data.length);
                        if ( value === false )
                                continue;
-                               
+
                        var firstChar = value.charAt(0).toLowerCase();
                        // if no lookup array for this character exists, look it up now
-                       if( !stMatchSets[firstChar] ) 
+                       if( !stMatchSets[firstChar] )
                                stMatchSets[firstChar] = [];
 
                        // if the match is a string
@@ -491,7 +491,7 @@ $.Autocompleter.Cache = function(options) {
                                data: rawValue,
                                result: options.formatResult && options.formatResult(rawValue) || value
                        };
-                       
+
                        // push the current match into the set list
                        stMatchSets[firstChar].push(row);
 
@@ -509,15 +509,15 @@ $.Autocompleter.Cache = function(options) {
                        add(i, value);
                });
        }
-       
+
        // populate any existing data
        setTimeout(populate, 25);
-       
+
        function flush(){
                data = {};
                length = 0;
        }
-       
+
        return {
                flush: flush,
                add: add,
@@ -525,7 +525,7 @@ $.Autocompleter.Cache = function(options) {
                load: function(q) {
                        if (!options.cacheLength || !length)
                                return null;
-                       /* 
+                       /*
                         * if dealing w/local data and matchContains than we must make sure
                         * to loop through all the data collections looking for matches
                         */
@@ -545,9 +545,9 @@ $.Autocompleter.Cache = function(options) {
                                                        }
                                                });
                                        }
-                               }                               
+                               }
                                return csub;
-                       } else 
+                       } else
                        // if the exact item exists, use it
                        if (data[q]){
                                return data[q];
@@ -575,7 +575,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
        var CLASSES = {
                ACTIVE: "ac_over"
        };
-       
+
        var listItems,
                active = -1,
                data,
@@ -583,7 +583,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
                needsInit = true,
                element,
                list;
-       
+
        // Create results
        function init() {
                if (!needsInit)
@@ -593,11 +593,11 @@ $.Autocompleter.Select = function (options, input, select, config) {
                .addClass(options.resultsClass)
                .css("position", "absolute")
                .appendTo(document.body);
-       
+
                list = $("<ul/>").appendTo(element).mouseover( function(event) {
                        if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
                    active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
-                           $(target(event)).addClass(CLASSES.ACTIVE);            
+                           $(target(event)).addClass(CLASSES.ACTIVE);
                }
                }).click(function(event) {
                        $(target(event)).addClass(CLASSES.ACTIVE);
@@ -610,13 +610,13 @@ $.Autocompleter.Select = function (options, input, select, config) {
                }).mouseup(function() {
                        config.mouseDownOnSelect = false;
                });
-               
+
                if( options.width > 0 )
                        element.css("width", options.width);
-                       
+
                needsInit = false;
-       } 
-       
+       }
+
        function target(event) {
                var element = event.target;
                while(element && element.tagName != "LI")
@@ -643,7 +643,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
             }
         }
        };
-       
+
        function movePosition(step) {
                active += step;
                if (active < 0) {
@@ -652,13 +652,13 @@ $.Autocompleter.Select = function (options, input, select, config) {
                        active = 0;
                }
        }
-       
+
        function limitNumberOfItems(available) {
                return options.max && options.max < available
                        ? options.max
                        : available;
        }
-       
+
        function fillList() {
                list.empty();
                var max = limitNumberOfItems(data.length);
@@ -680,7 +680,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
                if ( $.fn.bgiframe )
                        list.bgiframe();
        }
-       
+
        return {
                display: function(d, q) {
                        init();
@@ -732,7 +732,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
                                        maxHeight: options.scrollHeight,
                                        overflow: 'auto'
                                });
-                               
+
                 if($.browser.msie && typeof document.body.style.maxHeight === "undefined") {
                                        var listHeight = 0;
                                        listItems.each(function() {
@@ -745,7 +745,7 @@ $.Autocompleter.Select = function (options, input, select, config) {
                                                listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
                                        }
                 }
-                
+
             }
                },
                selected: function() {
index d2da4bc..5491667 100644 (file)
-/*!\r
- * jQuery blockUI plugin\r
- * Version 2.31 (06-JAN-2010)\r
- * @requires jQuery v1.2.3 or later\r
- *\r
- * Examples at: http://malsup.com/jquery/block/\r
- * Copyright (c) 2007-2008 M. Alsup\r
- * Dual licensed under the MIT and GPL licenses:\r
- * http://www.opensource.org/licenses/mit-license.php\r
- * http://www.gnu.org/licenses/gpl.html\r
- *\r
- * Thanks to Amir-Hossein Sobhi for some excellent contributions!\r
- */\r
-\r
-;(function($) {\r
-\r
-if (/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery) || /^1.1/.test($.fn.jquery)) {\r
-       alert('blockUI requires jQuery v1.2.3 or later!  You are using v' + $.fn.jquery);\r
-       return;\r
-}\r
-\r
-$.fn._fadeIn = $.fn.fadeIn;\r
-\r
-var noOp = function() {};\r
-\r
-// this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle\r
-// retarded userAgent strings on Vista)\r
-var mode = document.documentMode || 0;\r
-var setExpr = $.browser.msie && (($.browser.version < 8 && !mode) || mode < 8);\r
-var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent) && !mode;\r
-\r
-// global $ methods for blocking/unblocking the entire page\r
-$.blockUI   = function(opts) { install(window, opts); };\r
-$.unblockUI = function(opts) { remove(window, opts); };\r
-\r
-// convenience method for quick growl-like notifications  (http://www.google.com/search?q=growl)\r
-$.growlUI = function(title, message, timeout, onClose) {\r
-       var $m = $('<div class="growlUI"></div>');\r
-       if (title) $m.append('<h1>'+title+'</h1>');\r
-       if (message) $m.append('<h2>'+message+'</h2>');\r
-       if (timeout == undefined) timeout = 3000;\r
-       $.blockUI({\r
-               message: $m, fadeIn: 700, fadeOut: 1000, centerY: false,\r
-               timeout: timeout, showOverlay: false,\r
-               onUnblock: onClose, \r
-               css: $.blockUI.defaults.growlCSS\r
-       });\r
-};\r
-\r
-// plugin method for blocking element content\r
-$.fn.block = function(opts) {\r
-       return this.unblock({ fadeOut: 0 }).each(function() {\r
-               if ($.css(this,'position') == 'static')\r
-                       this.style.position = 'relative';\r
-               if ($.browser.msie)\r
-                       this.style.zoom = 1; // force 'hasLayout'\r
-               install(this, opts);\r
-       });\r
-};\r
-\r
-// plugin method for unblocking element content\r
-$.fn.unblock = function(opts) {\r
-       return this.each(function() {\r
-               remove(this, opts);\r
-       });\r
-};\r
-\r
-$.blockUI.version = 2.31; // 2nd generation blocking at no extra cost!\r
-\r
-// override these in your code to change the default behavior and style\r
-$.blockUI.defaults = {\r
-       // message displayed when blocking (use null for no message)\r
-       message:  '<h1>Please wait...</h1>',\r
-\r
-       title: null,      // title string; only used when theme == true\r
-       draggable: true,  // only used when theme == true (requires jquery-ui.js to be loaded)\r
-       \r
-       theme: false, // set to true to use with jQuery UI themes\r
-       \r
-       // styles for the message when blocking; if you wish to disable\r
-       // these and use an external stylesheet then do this in your code:\r
-       // $.blockUI.defaults.css = {};\r
-       css: {\r
-               padding:        0,\r
-               margin:         0,\r
-               width:          '30%',\r
-               top:            '40%',\r
-               left:           '35%',\r
-               textAlign:      'center',\r
-               color:          '#000',\r
-               border:         '3px solid #aaa',\r
-               backgroundColor:'#fff',\r
-               cursor:         'wait'\r
-       },\r
-       \r
-       // minimal style set used when themes are used\r
-       themedCSS: {\r
-               width:  '30%',\r
-               top:    '40%',\r
-               left:   '35%'\r
-       },\r
-\r
-       // styles for the overlay\r
-       overlayCSS:  {\r
-               backgroundColor: '#000',\r
-               opacity:                 0.6,\r
-               cursor:                  'wait'\r
-       },\r
-\r
-       // styles applied when using $.growlUI\r
-       growlCSS: {\r
-               width:          '350px',\r
-               top:            '10px',\r
-               left:           '',\r
-               right:          '10px',\r
-               border:         'none',\r
-               padding:        '5px',\r
-               opacity:        0.6,\r
-               cursor:         'default',\r
-               color:          '#fff',\r
-               backgroundColor: '#000',\r
-               '-webkit-border-radius': '10px',\r
-               '-moz-border-radius':    '10px'\r
-       },\r
-       \r
-       // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w\r
-       // (hat tip to Jorge H. N. de Vasconcelos)\r
-       iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',\r
-\r
-       // force usage of iframe in non-IE browsers (handy for blocking applets)\r
-       forceIframe: false,\r
-\r
-       // z-index for the blocking overlay\r
-       baseZ: 1000,\r
-\r
-       // set these to true to have the message automatically centered\r
-       centerX: true, // <-- only effects element blocking (page block controlled via css above)\r
-       centerY: true,\r
-\r
-       // allow body element to be stetched in ie6; this makes blocking look better\r
-       // on "short" pages.  disable if you wish to prevent changes to the body height\r
-       allowBodyStretch: true,\r
-\r
-       // enable if you want key and mouse events to be disabled for content that is blocked\r
-       bindEvents: true,\r
-\r
-       // be default blockUI will supress tab navigation from leaving blocking content\r
-       // (if bindEvents is true)\r
-       constrainTabKey: true,\r
-\r
-       // fadeIn time in millis; set to 0 to disable fadeIn on block\r
-       fadeIn:  200,\r
-\r
-       // fadeOut time in millis; set to 0 to disable fadeOut on unblock\r
-       fadeOut:  400,\r
-\r
-       // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock\r
-       timeout: 0,\r
-\r
-       // disable if you don't want to show the overlay\r
-       showOverlay: true,\r
-\r
-       // if true, focus will be placed in the first available input field when\r
-       // page blocking\r
-       focusInput: true,\r
-\r
-       // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)\r
-       applyPlatformOpacityRules: true,\r
-       \r
-       // callback method invoked when fadeIn has completed and blocking message is visible\r
-       onBlock: null,\r
-\r
-       // callback method invoked when unblocking has completed; the callback is\r
-       // passed the element that has been unblocked (which is the window object for page\r
-       // blocks) and the options that were passed to the unblock call:\r
-       //       onUnblock(element, options)\r
-       onUnblock: null,\r
-\r
-       // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493\r
-       quirksmodeOffsetHack: 4\r
-};\r
-\r
-// private data and functions follow...\r
-\r
-var pageBlock = null;\r
-var pageBlockEls = [];\r
-\r
-function install(el, opts) {\r
-       var full = (el == window);\r
-       var msg = opts && opts.message !== undefined ? opts.message : undefined;\r
-       opts = $.extend({}, $.blockUI.defaults, opts || {});\r
-       opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});\r
-       var css = $.extend({}, $.blockUI.defaults.css, opts.css || {});\r
-       var themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});\r
-       msg = msg === undefined ? opts.message : msg;\r
-\r
-       // remove the current block (if there is one)\r
-       if (full && pageBlock)\r
-               remove(window, {fadeOut:0});\r
-\r
-       // if an existing element is being used as the blocking content then we capture\r
-       // its current place in the DOM (and current display style) so we can restore\r
-       // it when we unblock\r
-       if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {\r
-               var node = msg.jquery ? msg[0] : msg;\r
-               var data = {};\r
-               $(el).data('blockUI.history', data);\r
-               data.el = node;\r
-               data.parent = node.parentNode;\r
-               data.display = node.style.display;\r
-               data.position = node.style.position;\r
-               if (data.parent)\r
-                       data.parent.removeChild(node);\r
-       }\r
-\r
-       var z = opts.baseZ;\r
-\r
-       // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;\r
-       // layer1 is the iframe layer which is used to supress bleed through of underlying content\r
-       // layer2 is the overlay layer which has opacity and a wait cursor (by default)\r
-       // layer3 is the message content that is displayed while blocking\r
-\r
-       var lyr1 = ($.browser.msie || opts.forceIframe) \r
-               ? $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>')\r
-               : $('<div class="blockUI" style="display:none"></div>');\r
-       var lyr2 = $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');\r
-       \r
-       var lyr3;\r
-       if (opts.theme && full) {\r
-               var s = '<div class="blockUI blockMsg blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+z+';display:none;position:fixed">' +\r
-                                       '<div class="ui-widget-header ui-dialog-titlebar blockTitle">'+(opts.title || '&nbsp;')+'</div>' +\r
-                                       '<div class="ui-widget-content ui-dialog-content"></div>' +\r
-                               '</div>';\r
-               lyr3 = $(s);\r
-       }\r
-       else {\r
-               lyr3 = full ? $('<div class="blockUI blockMsg blockPage" style="z-index:'+z+';display:none;position:fixed"></div>')\r
-                                       : $('<div class="blockUI blockMsg blockElement" style="z-index:'+z+';display:none;position:absolute"></div>');\r
-       }                                                  \r
-\r
-       // if we have a message, style it\r
-       if (msg) {\r
-               if (opts.theme) {\r
-                       lyr3.css(themedCSS);\r
-                       lyr3.addClass('ui-widget-content');\r
-               }\r
-               else \r
-                       lyr3.css(css);\r
-       }\r
-\r
-       // style the overlay\r
-       if (!opts.applyPlatformOpacityRules || !($.browser.mozilla && /Linux/.test(navigator.platform)))\r
-               lyr2.css(opts.overlayCSS);\r
-       lyr2.css('position', full ? 'fixed' : 'absolute');\r
-\r
-       // make iframe layer transparent in IE\r
-       if ($.browser.msie || opts.forceIframe)\r
-               lyr1.css('opacity',0.0);\r
-\r
-       //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);\r
-       var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);\r
-       $.each(layers, function() {\r
-               this.appendTo($par);\r
-       });\r
-       \r
-       if (opts.theme && opts.draggable && $.fn.draggable) {\r
-               lyr3.draggable({\r
-                       handle: '.ui-dialog-titlebar',\r
-                       cancel: 'li'\r
-               });\r
-       }\r
-\r
-       // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)\r
-       var expr = setExpr && (!$.boxModel || $('object,embed', full ? null : el).length > 0);\r
-       if (ie6 || expr) {\r
-               // give body 100% height\r
-               if (full && opts.allowBodyStretch && $.boxModel)\r
-                       $('html,body').css('height','100%');\r
-\r
-               // fix ie6 issue when blocked element has a border width\r
-               if ((ie6 || !$.boxModel) && !full) {\r
-                       var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');\r
-                       var fixT = t ? '(0 - '+t+')' : 0;\r
-                       var fixL = l ? '(0 - '+l+')' : 0;\r
-               }\r
-\r
-               // simulate fixed position\r
-               $.each([lyr1,lyr2,lyr3], function(i,o) {\r
-                       var s = o[0].style;\r
-                       s.position = 'absolute';\r
-                       if (i < 2) {\r
-                               full ? s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"')\r
-                                        : s.setExpression('height','this.parentNode.offsetHeight + "px"');\r
-                               full ? s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"')\r
-                                        : s.setExpression('width','this.parentNode.offsetWidth + "px"');\r
-                               if (fixL) s.setExpression('left', fixL);\r
-                               if (fixT) s.setExpression('top', fixT);\r
-                       }\r
-                       else if (opts.centerY) {\r
-                               if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');\r
-                               s.marginTop = 0;\r
-                       }\r
-                       else if (!opts.centerY && full) {\r
-                               var top = (opts.css && opts.css.top) ? parseInt(opts.css.top) : 0;\r
-                               var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';\r
-                               s.setExpression('top',expression);\r
-                       }\r
-               });\r
-       }\r
-\r
-       // show the message\r
-       if (msg) {\r
-               if (opts.theme)\r
-                       lyr3.find('.ui-widget-content').append(msg);\r
-               else\r
-                       lyr3.append(msg);\r
-               if (msg.jquery || msg.nodeType)\r
-                       $(msg).show();\r
-       }\r
-\r
-       if (($.browser.msie || opts.forceIframe) && opts.showOverlay)\r
-               lyr1.show(); // opacity is zero\r
-       if (opts.fadeIn) {\r
-               var cb = opts.onBlock ? opts.onBlock : noOp;\r
-               var cb1 = (opts.showOverlay && !msg) ? cb : noOp;\r
-               var cb2 = msg ? cb : noOp;\r
-               if (opts.showOverlay)\r
-                       lyr2._fadeIn(opts.fadeIn, cb1);\r
-               if (msg)\r
-                       lyr3._fadeIn(opts.fadeIn, cb2);\r
-       }\r
-       else {\r
-               if (opts.showOverlay)\r
-                       lyr2.show();\r
-               if (msg)\r
-                       lyr3.show();\r
-               if (opts.onBlock)\r
-                       opts.onBlock();\r
-       }\r
-\r
-       // bind key and mouse events\r
-       bind(1, el, opts);\r
-\r
-       if (full) {\r
-               pageBlock = lyr3[0];\r
-               pageBlockEls = $(':input:enabled:visible',pageBlock);\r
-               if (opts.focusInput)\r
-                       setTimeout(focus, 20);\r
-       }\r
-       else\r
-               center(lyr3[0], opts.centerX, opts.centerY);\r
-\r
-       if (opts.timeout) {\r
-               // auto-unblock\r
-               var to = setTimeout(function() {\r
-                       full ? $.unblockUI(opts) : $(el).unblock(opts);\r
-               }, opts.timeout);\r
-               $(el).data('blockUI.timeout', to);\r
-       }\r
-};\r
-\r
-// remove the block\r
-function remove(el, opts) {\r
-       var full = (el == window);\r
-       var $el = $(el);\r
-       var data = $el.data('blockUI.history');\r
-       var to = $el.data('blockUI.timeout');\r
-       if (to) {\r
-               clearTimeout(to);\r
-               $el.removeData('blockUI.timeout');\r
-       }\r
-       opts = $.extend({}, $.blockUI.defaults, opts || {});\r
-       bind(0, el, opts); // unbind events\r
-       \r
-       var els;\r
-       if (full) // crazy selector to handle odd field errors in ie6/7\r
-               els = $('body').children().filter('.blockUI').add('body > .blockUI');\r
-       else\r
-               els = $('.blockUI', el);\r
-\r
-       if (full)\r
-               pageBlock = pageBlockEls = null;\r
-\r
-       if (opts.fadeOut) {\r
-               els.fadeOut(opts.fadeOut);\r
-               setTimeout(function() { reset(els,data,opts,el); }, opts.fadeOut);\r
-       }\r
-       else\r
-               reset(els, data, opts, el);\r
-};\r
-\r
-// move blocking element back into the DOM where it started\r
-function reset(els,data,opts,el) {\r
-       els.each(function(i,o) {\r
-               // remove via DOM calls so we don't lose event handlers\r
-               if (this.parentNode)\r
-                       this.parentNode.removeChild(this);\r
-       });\r
-\r
-       if (data && data.el) {\r
-               data.el.style.display = data.display;\r
-               data.el.style.position = data.position;\r
-               if (data.parent)\r
-                       data.parent.appendChild(data.el);\r
-               $(el).removeData('blockUI.history');\r
-       }\r
-\r
-       if (typeof opts.onUnblock == 'function')\r
-               opts.onUnblock(el,opts);\r
-};\r
-\r
-// bind/unbind the handler\r
-function bind(b, el, opts) {\r
-       var full = el == window, $el = $(el);\r
-\r
-       // don't bother unbinding if there is nothing to unbind\r
-       if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))\r
-               return;\r
-       if (!full)\r
-               $el.data('blockUI.isBlocked', b);\r
-\r
-       // don't bind events when overlay is not in use or if bindEvents is false\r
-       if (!opts.bindEvents || (b && !opts.showOverlay)) \r
-               return;\r
-\r
-       // bind anchors and inputs for mouse and key events\r
-       var events = 'mousedown mouseup keydown keypress';\r
-       b ? $(document).bind(events, opts, handler) : $(document).unbind(events, handler);\r
-\r
-// former impl...\r
-//        var $e = $('a,:input');\r
-//        b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);\r
-};\r
-\r
-// event handler to suppress keyboard/mouse events when blocking\r
-function handler(e) {\r
-       // allow tab navigation (conditionally)\r
-       if (e.keyCode && e.keyCode == 9) {\r
-               if (pageBlock && e.data.constrainTabKey) {\r
-                       var els = pageBlockEls;\r
-                       var fwd = !e.shiftKey && e.target == els[els.length-1];\r
-                       var back = e.shiftKey && e.target == els[0];\r
-                       if (fwd || back) {\r
-                               setTimeout(function(){focus(back)},10);\r
-                               return false;\r
-                       }\r
-               }\r
-       }\r
-       // allow events within the message content\r
-       if ($(e.target).parents('div.blockMsg').length > 0)\r
-               return true;\r
-\r
-       // allow events for content that is not being blocked\r
-       return $(e.target).parents().children().filter('div.blockUI').length == 0;\r
-};\r
-\r
-function focus(back) {\r
-       if (!pageBlockEls)\r
-               return;\r
-       var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];\r
-       if (e)\r
-               e.focus();\r
-};\r
-\r
-function center(el, x, y) {\r
-       var p = el.parentNode, s = el.style;\r
-       var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');\r
-       var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');\r
-       if (x) s.left = l > 0 ? (l+'px') : '0';\r
-       if (y) s.top  = t > 0 ? (t+'px') : '0';\r
-};\r
-\r
-function sz(el, p) {\r
-       return parseInt($.css(el,p))||0;\r
-};\r
-\r
+/*!
+ * jQuery blockUI plugin
+ * Version 2.31 (06-JAN-2010)
+ * @requires jQuery v1.2.3 or later
+ *
+ * Examples at: http://malsup.com/jquery/block/
+ * Copyright (c) 2007-2008 M. Alsup
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * Thanks to Amir-Hossein Sobhi for some excellent contributions!
+ */
+
+;(function($) {
+
+if (/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery) || /^1.1/.test($.fn.jquery)) {
+       alert('blockUI requires jQuery v1.2.3 or later!  You are using v' + $.fn.jquery);
+       return;
+}
+
+$.fn._fadeIn = $.fn.fadeIn;
+
+var noOp = function() {};
+
+// this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle
+// retarded userAgent strings on Vista)
+var mode = document.documentMode || 0;
+var setExpr = $.browser.msie && (($.browser.version < 8 && !mode) || mode < 8);
+var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent) && !mode;
+
+// global $ methods for blocking/unblocking the entire page
+$.blockUI   = function(opts) { install(window, opts); };
+$.unblockUI = function(opts) { remove(window, opts); };
+
+// convenience method for quick growl-like notifications  (http://www.google.com/search?q=growl)
+$.growlUI = function(title, message, timeout, onClose) {
+       var $m = $('<div class="growlUI"></div>');
+       if (title) $m.append('<h1>'+title+'</h1>');
+       if (message) $m.append('<h2>'+message+'</h2>');
+       if (timeout == undefined) timeout = 3000;
+       $.blockUI({
+               message: $m, fadeIn: 700, fadeOut: 1000, centerY: false,
+               timeout: timeout, showOverlay: false,
+               onUnblock: onClose,
+               css: $.blockUI.defaults.growlCSS
+       });
+};
+
+// plugin method for blocking element content
+$.fn.block = function(opts) {
+       return this.unblock({ fadeOut: 0 }).each(function() {
+               if ($.css(this,'position') == 'static')
+                       this.style.position = 'relative';
+               if ($.browser.msie)
+                       this.style.zoom = 1; // force 'hasLayout'
+               install(this, opts);
+       });
+};
+
+// plugin method for unblocking element content
+$.fn.unblock = function(opts) {
+       return this.each(function() {
+               remove(this, opts);
+       });
+};
+
+$.blockUI.version = 2.31; // 2nd generation blocking at no extra cost!
+
+// override these in your code to change the default behavior and style
+$.blockUI.defaults = {
+       // message displayed when blocking (use null for no message)
+       message:  '<h1>Please wait...</h1>',
+
+       title: null,      // title string; only used when theme == true
+       draggable: true,  // only used when theme == true (requires jquery-ui.js to be loaded)
+
+       theme: false, // set to true to use with jQuery UI themes
+
+       // styles for the message when blocking; if you wish to disable
+       // these and use an external stylesheet then do this in your code:
+       // $.blockUI.defaults.css = {};
+       css: {
+               padding:        0,
+               margin:         0,
+               width:          '30%',
+               top:            '40%',
+               left:           '35%',
+               textAlign:      'center',
+               color:          '#000',
+               border:         '3px solid #aaa',
+               backgroundColor:'#fff',
+               cursor:         'wait'
+       },
+
+       // minimal style set used when themes are used
+       themedCSS: {
+               width:  '30%',
+               top:    '40%',
+               left:   '35%'
+       },
+
+       // styles for the overlay
+       overlayCSS:  {
+               backgroundColor: '#000',
+               opacity:                 0.6,
+               cursor:                  'wait'
+       },
+
+       // styles applied when using $.growlUI
+       growlCSS: {
+               width:          '350px',
+               top:            '10px',
+               left:           '',
+               right:          '10px',
+               border:         'none',
+               padding:        '5px',
+               opacity:        0.6,
+               cursor:         'default',
+               color:          '#fff',
+               backgroundColor: '#000',
+               '-webkit-border-radius': '10px',
+               '-moz-border-radius':    '10px'
+       },
+
+       // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w
+       // (hat tip to Jorge H. N. de Vasconcelos)
+       iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',
+
+       // force usage of iframe in non-IE browsers (handy for blocking applets)
+       forceIframe: false,
+
+       // z-index for the blocking overlay
+       baseZ: 1000,
+
+       // set these to true to have the message automatically centered
+       centerX: true, // <-- only effects element blocking (page block controlled via css above)
+       centerY: true,
+
+       // allow body element to be stetched in ie6; this makes blocking look better
+       // on "short" pages.  disable if you wish to prevent changes to the body height
+       allowBodyStretch: true,
+
+       // enable if you want key and mouse events to be disabled for content that is blocked
+       bindEvents: true,
+
+       // be default blockUI will supress tab navigation from leaving blocking content
+       // (if bindEvents is true)
+       constrainTabKey: true,
+
+       // fadeIn time in millis; set to 0 to disable fadeIn on block
+       fadeIn:  200,
+
+       // fadeOut time in millis; set to 0 to disable fadeOut on unblock
+       fadeOut:  400,
+
+       // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock
+       timeout: 0,
+
+       // disable if you don't want to show the overlay
+       showOverlay: true,
+
+       // if true, focus will be placed in the first available input field when
+       // page blocking
+       focusInput: true,
+
+       // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
+       applyPlatformOpacityRules: true,
+
+       // callback method invoked when fadeIn has completed and blocking message is visible
+       onBlock: null,
+
+       // callback method invoked when unblocking has completed; the callback is
+       // passed the element that has been unblocked (which is the window object for page
+       // blocks) and the options that were passed to the unblock call:
+       //       onUnblock(element, options)
+       onUnblock: null,
+
+       // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493
+       quirksmodeOffsetHack: 4
+};
+
+// private data and functions follow...
+
+var pageBlock = null;
+var pageBlockEls = [];
+
+function install(el, opts) {
+       var full = (el == window);
+       var msg = opts && opts.message !== undefined ? opts.message : undefined;
+       opts = $.extend({}, $.blockUI.defaults, opts || {});
+       opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
+       var css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
+       var themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
+       msg = msg === undefined ? opts.message : msg;
+
+       // remove the current block (if there is one)
+       if (full && pageBlock)
+               remove(window, {fadeOut:0});
+
+       // if an existing element is being used as the blocking content then we capture
+       // its current place in the DOM (and current display style) so we can restore
+       // it when we unblock
+       if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
+               var node = msg.jquery ? msg[0] : msg;
+               var data = {};
+               $(el).data('blockUI.history', data);
+               data.el = node;
+               data.parent = node.parentNode;
+               data.display = node.style.display;
+               data.position = node.style.position;
+               if (data.parent)
+                       data.parent.removeChild(node);
+       }
+
+       var z = opts.baseZ;
+
+       // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
+       // layer1 is the iframe layer which is used to supress bleed through of underlying content
+       // layer2 is the overlay layer which has opacity and a wait cursor (by default)
+       // layer3 is the message content that is displayed while blocking
+
+       var lyr1 = ($.browser.msie || opts.forceIframe)
+               ? $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>')
+               : $('<div class="blockUI" style="display:none"></div>');
+       var lyr2 = $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
+
+       var lyr3;
+       if (opts.theme && full) {
+               var s = '<div class="blockUI blockMsg blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+z+';display:none;position:fixed">' +
+                                       '<div class="ui-widget-header ui-dialog-titlebar blockTitle">'+(opts.title || '&nbsp;')+'</div>' +
+                                       '<div class="ui-widget-content ui-dialog-content"></div>' +
+                               '</div>';
+               lyr3 = $(s);
+       }
+       else {
+               lyr3 = full ? $('<div class="blockUI blockMsg blockPage" style="z-index:'+z+';display:none;position:fixed"></div>')
+                                       : $('<div class="blockUI blockMsg blockElement" style="z-index:'+z+';display:none;position:absolute"></div>');
+       }
+
+       // if we have a message, style it
+       if (msg) {
+               if (opts.theme) {
+                       lyr3.css(themedCSS);
+                       lyr3.addClass('ui-widget-content');
+               }
+               else
+                       lyr3.css(css);
+       }
+
+       // style the overlay
+       if (!opts.applyPlatformOpacityRules || !($.browser.mozilla && /Linux/.test(navigator.platform)))
+               lyr2.css(opts.overlayCSS);
+       lyr2.css('position', full ? 'fixed' : 'absolute');
+
+       // make iframe layer transparent in IE
+       if ($.browser.msie || opts.forceIframe)
+               lyr1.css('opacity',0.0);
+
+       //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
+       var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);
+       $.each(layers, function() {
+               this.appendTo($par);
+       });
+
+       if (opts.theme && opts.draggable && $.fn.draggable) {
+               lyr3.draggable({
+                       handle: '.ui-dialog-titlebar',
+                       cancel: 'li'
+               });
+       }
+
+       // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
+       var expr = setExpr && (!$.boxModel || $('object,embed', full ? null : el).length > 0);
+       if (ie6 || expr) {
+               // give body 100% height
+               if (full && opts.allowBodyStretch && $.boxModel)
+                       $('html,body').css('height','100%');
+
+               // fix ie6 issue when blocked element has a border width
+               if ((ie6 || !$.boxModel) && !full) {
+                       var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');
+                       var fixT = t ? '(0 - '+t+')' : 0;
+                       var fixL = l ? '(0 - '+l+')' : 0;
+               }
+
+               // simulate fixed position
+               $.each([lyr1,lyr2,lyr3], function(i,o) {
+                       var s = o[0].style;
+                       s.position = 'absolute';
+                       if (i < 2) {
+                               full ? s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"')
+                                        : s.setExpression('height','this.parentNode.offsetHeight + "px"');
+                               full ? s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"')
+                                        : s.setExpression('width','this.parentNode.offsetWidth + "px"');
+                               if (fixL) s.setExpression('left', fixL);
+                               if (fixT) s.setExpression('top', fixT);
+                       }
+                       else if (opts.centerY) {
+                               if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
+                               s.marginTop = 0;
+                       }
+                       else if (!opts.centerY && full) {
+                               var top = (opts.css && opts.css.top) ? parseInt(opts.css.top) : 0;
+                               var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';
+                               s.setExpression('top',expression);
+                       }
+               });
+       }
+
+       // show the message
+       if (msg) {
+               if (opts.theme)
+                       lyr3.find('.ui-widget-content').append(msg);
+               else
+                       lyr3.append(msg);
+               if (msg.jquery || msg.nodeType)
+                       $(msg).show();
+       }
+
+       if (($.browser.msie || opts.forceIframe) && opts.showOverlay)
+               lyr1.show(); // opacity is zero
+       if (opts.fadeIn) {
+               var cb = opts.onBlock ? opts.onBlock : noOp;
+               var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
+               var cb2 = msg ? cb : noOp;
+               if (opts.showOverlay)
+                       lyr2._fadeIn(opts.fadeIn, cb1);
+               if (msg)
+                       lyr3._fadeIn(opts.fadeIn, cb2);
+       }
+       else {
+               if (opts.showOverlay)
+                       lyr2.show();
+               if (msg)
+                       lyr3.show();
+               if (opts.onBlock)
+                       opts.onBlock();
+       }
+
+       // bind key and mouse events
+       bind(1, el, opts);
+
+       if (full) {
+               pageBlock = lyr3[0];
+               pageBlockEls = $(':input:enabled:visible',pageBlock);
+               if (opts.focusInput)
+                       setTimeout(focus, 20);
+       }
+       else
+               center(lyr3[0], opts.centerX, opts.centerY);
+
+       if (opts.timeout) {
+               // auto-unblock
+               var to = setTimeout(function() {
+                       full ? $.unblockUI(opts) : $(el).unblock(opts);
+               }, opts.timeout);
+               $(el).data('blockUI.timeout', to);
+       }
+};
+
+// remove the block
+function remove(el, opts) {
+       var full = (el == window);
+       var $el = $(el);
+       var data = $el.data('blockUI.history');
+       var to = $el.data('blockUI.timeout');
+       if (to) {
+               clearTimeout(to);
+               $el.removeData('blockUI.timeout');
+       }
+       opts = $.extend({}, $.blockUI.defaults, opts || {});
+       bind(0, el, opts); // unbind events
+
+       var els;
+       if (full) // crazy selector to handle odd field errors in ie6/7
+               els = $('body').children().filter('.blockUI').add('body > .blockUI');
+       else
+               els = $('.blockUI', el);
+
+       if (full)
+               pageBlock = pageBlockEls = null;
+
+       if (opts.fadeOut) {
+               els.fadeOut(opts.fadeOut);
+               setTimeout(function() { reset(els,data,opts,el); }, opts.fadeOut);
+       }
+       else
+               reset(els, data, opts, el);
+};
+
+// move blocking element back into the DOM where it started
+function reset(els,data,opts,el) {
+       els.each(function(i,o) {
+               // remove via DOM calls so we don't lose event handlers
+               if (this.parentNode)
+                       this.parentNode.removeChild(this);
+       });
+
+       if (data && data.el) {
+               data.el.style.display = data.display;
+               data.el.style.position = data.position;
+               if (data.parent)
+                       data.parent.appendChild(data.el);
+               $(el).removeData('blockUI.history');
+       }
+
+       if (typeof opts.onUnblock == 'function')
+               opts.onUnblock(el,opts);
+};
+
+// bind/unbind the handler
+function bind(b, el, opts) {
+       var full = el == window, $el = $(el);
+
+       // don't bother unbinding if there is nothing to unbind
+       if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))
+               return;
+       if (!full)
+               $el.data('blockUI.isBlocked', b);
+
+       // don't bind events when overlay is not in use or if bindEvents is false
+       if (!opts.bindEvents || (b && !opts.showOverlay))
+               return;
+
+       // bind anchors and inputs for mouse and key events
+       var events = 'mousedown mouseup keydown keypress';
+       b ? $(document).bind(events, opts, handler) : $(document).unbind(events, handler);
+
+// former impl...
+//        var $e = $('a,:input');
+//        b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
+};
+
+// event handler to suppress keyboard/mouse events when blocking
+function handler(e) {
+       // allow tab navigation (conditionally)
+       if (e.keyCode && e.keyCode == 9) {
+               if (pageBlock && e.data.constrainTabKey) {
+                       var els = pageBlockEls;
+                       var fwd = !e.shiftKey && e.target == els[els.length-1];
+                       var back = e.shiftKey && e.target == els[0];
+                       if (fwd || back) {
+                               setTimeout(function(){focus(back)},10);
+                               return false;
+                       }
+               }
+       }
+       // allow events within the message content
+       if ($(e.target).parents('div.blockMsg').length > 0)
+               return true;
+
+       // allow events for content that is not being blocked
+       return $(e.target).parents().children().filter('div.blockUI').length == 0;
+};
+
+function focus(back) {
+       if (!pageBlockEls)
+               return;
+       var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];
+       if (e)
+               e.focus();
+};
+
+function center(el, x, y) {
+       var p = el.parentNode, s = el.style;
+       var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');
+       var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');
+       if (x) s.left = l > 0 ? (l+'px') : '0';
+       if (y) s.top  = t > 0 ? (t+'px') : '0';
+};
+
+function sz(el, p) {
+       return parseInt($.css(el,p))||0;
+};
+
 })(jQuery);
\ No newline at end of file
index 47d8412..f5fe841 100644 (file)
@@ -1152,7 +1152,7 @@ var Editor = (function(){
       }
       // Create a part corresponding to a given token.
       function tokenPart(token){
-        var part = makePartSpan(token.value, self.doc);     
+        var part = makePartSpan(token.value, self.doc);
         part.className = token.style;
         return part;
       }
index 95a8099..87fbf0c 100644 (file)
@@ -130,7 +130,7 @@ var XMLParser = Editor.Parser = (function() {
     var tokenNr = 0, indented = 0;
     var currentTag = null, context = null;
     var consume, marked;
-    
+
     function push(fs) {
       for (var i = fs.length - 1; i >= 0; i--)
         cc.push(fs[i]);
@@ -267,7 +267,7 @@ var XMLParser = Editor.Parser = (function() {
       copy: function(){
         var _cc = cc.concat([]), _tokenState = tokens.state, _context = context;
         var parser = this;
-        
+
         return function(input){
           cc = _cc.concat([]);
           tokenNr = indented = 0;
index 071970c..b0c9545 100644 (file)
@@ -43,7 +43,7 @@ function tokenizer(source, state) {
         source.next();
         return this.take("whitespace");
       }
-      
+
       if (source.applies(isWhiteSpace))
         type = "whitespace";
       else
index 8be7758..9e17ba7 100644 (file)
         }
         return downcoded;
     }
-    
+
     slugify = function(s) {
         s = downcode(s);
         // if downcode doesn't hit, the char will be stripped here
         s = s.replace(/^\s+|\s+$/g, ''); // trim leading/trailing spaces
         s = s.replace(/[-\s]+/g, '-');   // convert spaces to hyphens
         s = s.toLowerCase();             // convert to lowercase
-        
+
         return s;
     }
 })();
index 429b0e6..40a2942 100644 (file)
-(function($) 
-{              
+(function($)
+{
        var noop = function() { };
-       
+
        $.wiki = {
                perspectives: {},
-               cls: {}         
+               cls: {}
        };
-       
-       $.wiki.activePerspective = function() { 
+
+       $.wiki.activePerspective = function() {
                return this.perspectives[$("#tabs li.active").attr('id')];
        };
-       
+
        $.wiki.exitContext = function() {
                var ap = this.activePerspective();
                if(ap) ap.onExit();
-               return ap;      
+               return ap;
        };
-       
+
        $.wiki.enterContext = function(ap) {
-               if(ap) ap.onEnter();                            
+               if(ap) ap.onEnter();
        };
-       
+
        $.wiki.isDirty = function() {
                var ap = this.activePerspective();
-               return (!!CurrentDocument && CurrentDocument.has_local_changes) || ap.dirty(); 
+               return (!!CurrentDocument && CurrentDocument.has_local_changes) || ap.dirty();
        };
-       
+
        $.wiki.newTab = function(doc, title, klass) {
                var base_id = 'id' + Math.floor(Math.random()* 5000000000);
                var id = (''+klass)+'_' + base_id;
                var $tab = $('<li id="'+id+'" data-ui-related="'+base_id+'" data-ui-jsclass="'+klass+'" >'
                                + title + '<img src="/static/icons/close.png" class="tabclose"></li>');
-               var $view = $('<div class="editor '+klass+'" id="'+base_id+'"> </div>');                
-               
+               var $view = $('<div class="editor '+klass+'" id="'+base_id+'"> </div>');
+
                this.perspectives[id] = new $.wiki[klass]({
                        doc: doc,
                        id: id,
                        base_id: base_id,
-               });             
-               
-               $('#tabs').append($tab);                                        
-               $view.hide().appendTo('#editor');                       
+               });
+
+               $('#tabs').append($tab);
+               $view.hide().appendTo('#editor');
                return {
                        tab: $tab[0],
                        view: $view[0],
-               };                                                      
+               };
        };
-       
+
        $.wiki.initTab = function(options) {
                var klass = $(options.tab).attr('data-ui-jsclass');
-               
+
                return new $.wiki[klass]({
                        doc: options.doc,
                        id: $(options.tab).attr('id'),
                        callback: function() {
                                $.wiki.perspectives[this.perspective_id] = this;
                                if(options.callback)
-                                       options.callback.call(this);                            
-                       }                       
+                                       options.callback.call(this);
+                       }
                });
        };
-       
+
        $.wiki.perspectiveForTab = function(tab) { // element or id
                return this.perspectives[ $(tab).attr('id')];
        }
-       
+
        $.wiki.switchToTab = function(tab){
                var self = this;
                var $tab = $(tab);
-               
-               if($tab.length != 1) 
+
+               if($tab.length != 1)
                        $tab = $(DEFAULT_PERSPECTIVE);
-               
+
                var $old = $('#tabs li').filter('.active');
-                               
+
                $old.each(function(){
                        $(this).removeClass('active');
                        $('#' + $(this).attr('data-ui-related')).hide();
                        self.perspectives[$(this).attr('id')].onExit();
                });
-               
+
                /* show new */
                $tab.addClass('active');
                $('#' + $tab.attr('data-ui-related')).show();
-               
+
                console.log($tab);
                console.log($.wiki.perspectives);
-               
+
                $.wiki.perspectives[$tab.attr('id')].onEnter();
        };
-       
+
        /*
         * Basic perspective.
         */
        $.wiki.Perspective = function(options) {
                if(!options) return;
-               
+
                this.doc = options.doc;
                if (options.id) {
                        this.perspective_id = options.id;
                else {
                        this.perspective_id = '';
                }
-                               
+
                if(options.callback)
                        options.callback.call(this);
        };
-       
+
        $.wiki.Perspective.prototype.toString = function() {
                return this.perspective_id;
        };
-       
+
        $.wiki.Perspective.prototype.dirty = function() {
                return true;
        };
-       
+
        $.wiki.Perspective.prototype.onEnter = function () {
                // called when perspective in initialized
                if (this.perspective_id) {
                        document.location.hash = '#' + this.perspective_id;
                }
-                        
+
                console.log(document.location.hash);
        };
-       
+
        $.wiki.Perspective.prototype.onExit = function () {
-               // called when user switches to another perspective 
+               // called when user switches to another perspective
                document.location.hash = '';
-       };       
-       
+       };
+
        $.wiki.Perspective.prototype.destroy = function() {
-               // pass         
+               // pass
        };
-       
+
        $.wiki.Perspective.prototype.freezeState = function () {
                // free UI state (don't store data here)
        };
-       
+
        $.wiki.Perspective.prototype.unfreezeState = function (frozenState) {
                // restore UI state
        };
-       
+
        /*
         * Stub rendering (used in generating history)
         */
-       $.wiki.renderStub = function($container, $stub, data) 
+       $.wiki.renderStub = function(params)
        {
-               var $elem = $stub.clone();
+               params = $.extend({ 'filters': {} }, params);
+               var $elem = params.stub.clone();
                $elem.removeClass('row-stub');
-               $container.append($elem);
-       
+               params.container.append($elem);
+
                $('*[data-stub-value]', $elem).each(function() {
                        var $this = $(this);
                        var field = $this.attr('data-stub-value');
-                       var value = data[field];
-               
+
+                       var value = params.data[field];
+
+                       if(params.filters[field])
+                               value = params.filters[field](value);
+
                        if(value === null || value === undefined) return;
-                        
+
                        if(!$this.attr('data-stub-target')) {
-                               $this.text(value);                      
-                       }               
+                               $this.text(value);
+                       }
                        else {
                                $this.attr($this.attr('data-stub-target'), value);
                                $this.removeAttr('data-stub-target');
-                               $this.removeAttr('data-stub-value');                    
-                       }               
+                               $this.removeAttr('data-stub-value');
+                       }
                });
-       
+
                $elem.show();
-               return $elem;                                           
+               return $elem;
        };
-       
+
        /*
         * Dialogs
         */
        function GenericDialog(element) {
                if(!element) return;
-               
+
                var self = this;
-                               
+
                self.$elem = $(element);
-               
+
                if(!self.$elem.attr('data-ui-initialized')) {
                        console.log("Initializing dialog", this);
                        self.initialize();
-                       self.$elem.attr('data-ui-initialized', true);                   
+                       self.$elem.attr('data-ui-initialized', true);
                }
-                
-               self.show();                            
+
+               self.show();
        };
-       
+
        GenericDialog.prototype = {
-       
+
                /*
                * Steps to follow when the dialog in first loaded on page.
                */
                initialize: function(){
                        var self = this;
-                       
+
                        /* bind buttons */
                        $('button[data-ui-action]', self.$elem).click(function(event) {
                                event.preventDefault();
-                               
+
                                var action = $(this).attr('data-ui-action');
                                console.log("Button pressed, action: ", action);
-                                
+
                                try {
                                        self[action + "Action"].call(self);
                                } catch(e) {
                                        console.log("Action failed:", e);
                                        // always hide on cancel
                                        if(action == 'cancel')
-                                               self.hide();                                    
-                               }                                                               
-                       });                     
+                                               self.hide();
+                               }
+                       });
                },
-               
-               /* 
+
+               /*
                 * Prepare dialog for user. Clear any unnessary data.
                */
                show: function() {
                                }
                        });
                },
-               
+
                hide: function(){
                        $.unblockUI();
                },
-               
+
                cancelAction: function() {
-                       this.hide();                    
+                       this.hide();
                },
-               
+
                doneAction: function() {
                        this.hide();
                },
-               
+
                clearForm: function() {
                        $("*[data-ui-error-for]", this.$elem).text('');
                },
-               
+
                reportErrors: function(errors) {
                        var global = $("*[data-ui-error-for='__all__']", this.$elem);
                        var unassigned = [];
-                       
-                       for (var field_name in errors) 
-                       {                               
+
+                       for (var field_name in errors)
+                       {
                                var span = $("*[data-ui-error-for='"+field_name+"']", this.$elem);
-                               
+
                                if(!span.length) {
                                        unassigned.push(field_name);
                                        continue;
                                }
-                               
-                               span.text(errors[field_name].join(' '));        
+
+                               span.text(errors[field_name].join(' '));
                        }
-                       
+
                        if(unassigned.length > 0)
                                global.text( global.text() + 'W formularzu wystąpiły błędy');
-               }       
-       };       
-       
-       $.wiki.cls.GenericDialog = GenericDialog;  
-        
-       $.wiki.showDialog = function(selector) {
+               }
+       };
+
+       $.wiki.cls.GenericDialog = GenericDialog;
+
+       $.wiki.showDialog = function(selector, options) {
                var elem = $(selector);
-               
+
                if(elem.length != 1) {
                        console.log("Failed to show dialog:", selector, elem);
-                       return false;                   
+                       return false;
                }
-               
-               try {   
-                   var klass = elem.attr('data-ui-jsclass') 
-                       return new $.wiki.cls[klass](elem);                                             
+
+               try {
+                   var klass = elem.attr('data-ui-jsclass');
+                       return new $.wiki.cls[klass](elem, options);
                } catch(e) {
                        console.log("Failed to show dialog", selector, klass, e);
                        return false;
-               }                
+               }
        };
-       
+
 })(jQuery);
diff --git a/platforma/static/js/wiki/dialog_addtag.js b/platforma/static/js/wiki/dialog_addtag.js
new file mode 100644 (file)
index 0000000..42a8148
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Dialog for saving document to the server
+ *
+ */
+(function($){
+
+    function AddTagDialog(element, options){
+        if (!options.revision  && options.revision != 0)
+            throw "AddTagDialog needs a revision number.";
+
+        this.ctx = $.wiki.exitContext();
+        this.clearForm();
+
+        /* fill out hidden fields */
+        this.$form = $('form', element);
+
+        $("input[name='id']", this.$form).val(CurrentDocument.id);
+        $("input[name='revision']", this.$form).val(options.revision);
+
+        $.wiki.cls.GenericDialog.call(this, element);
+    };
+
+    AddTagDialog.prototype = $.extend(new $.wiki.cls.GenericDialog(), {
+        cancelAction: function(){
+            $.wiki.enterContext(this.ctx);
+            this.hide();
+        },
+
+        saveAction: function(){
+            var self = this;
+
+            self.$elem.block({
+                message: "Dodawanie tagu",
+                fadeIn: 0,
+            });
+
+            CurrentDocument.setTag({
+                form: self.$form,
+                success: function(doc, changed, info){
+                    self.$elem.block({
+                        message: info,
+                        timeout: 2000,
+                        fadeOut: 0,
+                        onUnblock: function(){
+                            self.hide();
+                            $.wiki.enterContext(self.ctx);
+                        }
+                    });
+                },
+                failure: function(doc, info){
+                    console.log("Failure", info);
+                    self.reportErrors(info);
+                    self.$elem.unblock();
+                }
+            });
+        }
+    });
+
+    /* make it global */
+    $.wiki.cls.AddTagDialog = AddTagDialog;
+})(jQuery);
diff --git a/platforma/static/js/wiki/dialog_save.js b/platforma/static/js/wiki/dialog_save.js
new file mode 100644 (file)
index 0000000..12f131f
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Dialog for saving document to the server
+ *
+ */
+(function($) {
+
+       function SaveDialog(element) {
+               this.ctx = $.wiki.exitContext();
+               this.clearForm();
+
+               /* fill out hidden fields */
+               this.$form = $('form', element);
+
+               $("input[name='id']", this.$form).val(CurrentDocument.id);
+               $("input[name='parent_revision']", this.$form).val(CurrentDocument.revision);
+
+               $.wiki.cls.GenericDialog.call(this, element);
+       };
+
+       SaveDialog.prototype = new $.wiki.cls.GenericDialog();
+
+       SaveDialog.prototype.cancelAction = function() {
+               $.wiki.enterContext(this.ctx);
+               this.hide();
+       };
+
+       SaveDialog.prototype.saveAction = function() {
+                       var self = this;
+
+                       self.$elem.block({
+                               message: "Zapisywanie...",
+                               fadeIn: 0,
+                       });
+
+                       try {
+
+                               CurrentDocument.save({
+                                       form: self.$form,
+                                       success: function(doc, changed, info){
+                                               self.$elem.block({
+                                                       message: info,
+                                                       timeout: 2000,
+                                                       fadeOut: 0,
+                                                       onUnblock: function() {
+                                                               self.hide();
+                                                               $.wiki.enterContext(self.ctx);
+                                                       }
+                                               });
+                                       },
+                                       failure: function(doc, info) {
+                                               console.log("Failure", info);
+                                               self.reportErrors(info);
+                                               self.$elem.unblock();
+                                       }
+                               });
+                       } catch(e) {
+                               console.log('Exception:', e)
+                               self.$elem.unblock();
+                       }
+       }; /* end of save dialog */
+
+       /* make it global */
+       $.wiki.cls.SaveDialog = SaveDialog;
+})(jQuery);
diff --git a/platforma/static/js/wiki/diff_view.js b/platforma/static/js/wiki/diff_view.js
deleted file mode 100644 (file)
index d6e71a6..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-(function($){
-       
-       function DiffPerspective(options) {
-               var old_callback = options.callback || function() {};
-               var self = this;
-                       
-        options.callback = function(){
-                       self.base_id = options.base_id;                 
-                       old_callback.call(this);
-               };              
-               
-               $.wiki.Perspective.call(this, options);
-    };
-    
-    DiffPerspective.prototype = new $.wiki.Perspective();
-    
-    DiffPerspective.prototype.freezeState = function(){
-        // must 
-    };
-       
-       DiffPerspective.prototype.destroy = function() {
-               $('#' + this.base_id).remove();
-               $('#' + this.perspective_id).remove();
-       };
-       
-       DiffPerspective.prototype.onEnter = function(success, failure){
-               $.wiki.Perspective.prototype.onEnter.call(this);
-               console.log("Entered diff view");
-       };
-       
-       $.wiki.DiffPerspective = DiffPerspective;
-       
-})(jQuery);
-
diff --git a/platforma/static/js/wiki/history_view.js b/platforma/static/js/wiki/history_view.js
deleted file mode 100644 (file)
index 2ee4558..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-(function($){
-    
-    function HistoryPerspective(options) {
-               var old_callback = options.callback || function() {};
-               
-               options.callback = function() {
-                       var self = this;
-                       
-                       // first time page is rendered
-               $('#make-diff-button').click(function() {
-                               self.makeDiff();
-                       });
-                       
-                       $('#tag-changeset-button').click(function() {
-                               self.showTagForm();                             
-                       });
-        
-               $('#changes-list .entry').live('click', function(){
-               var $this = $(this);
-               if ($this.hasClass('selected')) 
-                       return $this.removeClass('selected');
-            
-               if ($("#changes-list .entry.selected").length < 2) 
-                       return $this.addClass('selected');
-               });
-               
-           $('#changes-list span.tag').live('click', function(event){
-                   return false;
-               });
-        
-               old_callback.call(this);
-               }
-               
-               $.wiki.Perspective.call(this, options);         
-    };
-    
-    HistoryPerspective.prototype = new $.wiki.Perspective();
-    
-    HistoryPerspective.prototype.freezeState = function(){
-        // must 
-    };
-    
-    HistoryPerspective.prototype.onEnter = function(success, failure){
-        $.wiki.Perspective.prototype.onEnter.call(this);
-        
-        $.blockUI({
-            message: 'Odświeżanie historii...'
-        });
-        
-        function _finalize(s){
-            $.unblockUI();
-            
-            if (s) {
-                if (success) 
-                    success();
-            }
-            else {
-                if (failure) 
-                    failure();
-            }
-        }
-        
-        function _failure(doc, message){
-            $('#history-view .message-box').html('Nie udało się odświeżyć historii:' + message).show();
-            _finalize(false);
-        };
-        
-        function _success(doc, data){
-            $('#history-view .message-box').hide();
-            var changes_list = $('#changes-list');
-            var $stub = $('#history-view .row-stub');
-            changes_list.html('');
-            
-            $.each(data, function(){
-                $.wiki.renderStub(changes_list, $stub, this);
-            });
-            
-            $('span[data-version-tag]', changes_list).each(function(){
-                $(this).text($(this).attr('data-version-tag'));
-            });
-            
-            _finalize(true);
-        };
-        
-        return this.doc.fetchHistory({
-            success: _success,
-            failure: _failure
-        });
-    };
-       
-       HistoryPerspective.prototype.showTagForm = function(){
-               var selected = $('#changes-list .entry.selected');
-               
-               if (selected.length != 1) {
-            window.alert("Musisz dokładnie jedną wersję do oznaczenia.");            
-            return;
-        }
-               
-               var version = parseInt($("*[data-stub-value='version']", selected[0]).text());
-               var dialog = $('#add_tag_dialog');
-               
-               $("input[name='version']", dialog).val(version);
-               
-               console.log($('form', dialog).serialize());
-               
-               $.blockUI({
-                       message: dialog
-               });
-       };
-       
-       HistoryPerspective.prototype.makeDiff = function() {
-        var changelist = $('#changes-list');        
-        var selected = $('.entry.selected', changelist);
-        
-        if (selected.length != 2) {
-            window.alert("Musisz zaznaczyć dokładnie dwie wersje do porównania.");            
-            return;
-        }
-        
-        $.blockUI({
-            message: 'Wczytywanie porównania...'
-        });
-               
-               var rev_from = $("*[data-stub-value='version']", selected[1]).text();
-               var rev_to =  $("*[data-stub-value='version']", selected[0]).text();
-        
-        return this.doc.fetchDiff({
-            from: rev_from, 
-                       to: rev_to,            
-            success: function(doc, data){
-                var result = $.wiki.newTab(doc, ''+rev_from +' -> ' + rev_to, 'DiffPerspective');
-                               
-                               $(result.view).html(data);
-                               $.wiki.switchToTab(result.tab); 
-                               $.unblockUI();
-            },
-            failure: function(doc){
-                $.unblockUI();
-            }
-        });
-    };
-    
-    $.wiki.HistoryPerspective = HistoryPerspective;
-    
-})(jQuery);
diff --git a/platforma/static/js/wiki/loader.js b/platforma/static/js/wiki/loader.js
new file mode 100644 (file)
index 0000000..62eb25e
--- /dev/null
@@ -0,0 +1,135 @@
+if (!window.console) {
+    window.console = {
+        log: function(){
+        }
+    }
+}
+
+var DEFAULT_PERSPECTIVE = "#SummaryPerspective";
+
+THEMES = [
+       'Alkohol', 'Ambicja', 'Anioł', 'Antysemityzm', 'Arkadia', 'Artysta', 'Bezdomność', 'Bezpieczeństwo', 'Bieda', 'Bijatyka', 'Błazen', 'Błądzenie', 'Błoto', 'Bogactwo', 'Bóg', 'Brat', 'Bunt', 'Buntownik', 'Burza', 'Car', 'Carpe diem', 'Ciemność', 'Cień', 'Cisza', 'Chciwość', 'Chleb', 'Chłop', 'Choroba', 'Chrystus', 'Chrzest', 'Ciało', 'Cierpienie', 'Cmentarz', 'Cnota', 'Córka', 'Cud', 'Czarownika', 'Czary', 'Czas', 'Czyn', 'Czyściec', 'Dama', 'Danse macabre', 'Deszcz', 'Diabeł', 'Dobro', 'Dom', 'Dorosłość', 'Drzewo', 'Duch', 'Dusza', 'Duma', 'Dworek', 'Dworzanin', 'Dwór', 'Dzieciństwo', 'Dziecko', 'Dziedzictwo', 'Dziewictwo', 'Dźwięk', 'Egzorcyzm', 'Elita', 'Emigrant', 'Fałsz', 'Filozof', 'Fircyk', 'Flirt', 'Głupiec', 'Głupota', 'Głód', 'Gospodarz', 'Gospodyni', 'Gość', 'Gotycyzm', 'Góra', 'Gra', 'Grób', 'Grzech', 'Grzeczność', 'Gwiazda', 'Handel', 'Hańba', 'Historia', 'Honor', 'Idealista', 'Imię', 'Interes', 'Jabłka', 'Jedzenie', 'Jesień', 'Kaleka', 'Kara', 'Karczma', 'Klęska', 'Kłamstwo', 'Kłótnia', 'Kobieta', 'Kobieta demoniczna', 'Kobieta "upadła"', 'Kochanek', 'Kochanek romantyczny', 'Kolonializm', 'Kondycja ludzka', 'Konflikt', 'Konflikt wewnętrzny', 'Koniec świata', 'Koń', 'Korzyść', 'Kot', 'Kradzież', 'Krew', 'Król', 'Krzywda', 'Ksiądz', 'Książka', 'Księżyc', 'Kuchnia', 'Kuszenie', 'Kwiaty', 'Labirynt', 'Las', 'Lato', 'Lekarz', 'Lenistwo', 'List', 'Liberat', 'Los', 'Lud', 'Lustro', 'Łzy', 'Małżeństwo', 'Marzenie', 'Maska', 'Maszyna', 'Matka', 'Matka Boska', 'Mądrość', 'Mąż', 'Melancholia', 'Mędrzec', 'Mężczyzna', 'Miasto', 'Mieszczanin', 'Miłosierdzie', 'Miłość', 'Miłość niespełniona', 'Miłość platoniczna', 'Miłość romantyczna', 'Miłość silniejsza niż śmierć', 'Miłość spełniona', 'Miłość tragiczna', 'Mizoginia', 'Młodość', 'Moda', 'Modlitwa', 'Morderstwo', 'Morze', 'Motyl', 'Mucha', 'Muzyka', 'Narodziny', 'Naród', 'Natura', 'Nauczyciel', 'Nauczycielka', 'Nauka', 'Niebezpieczeństwo', 'Niedziela', 'Niemiec', 'Nienawiść', 'Nieśmiertelność', 'Niewola', 'Noc', 'Nuda', 'Obcy', 'Obłok', 'Obowiązek', 'Obraz świata', 'Obrzędy', 'Obyczaje', 'Obywatel', 'Odrodzenie przez grób', 'Odwaga', 'Ofiara', 'Ogień', 'Ogród', 'Ojciec', 'Ojczyzna', 'Oko', 'Okręt', 'Okrucieństwo', 'Omen', 'Opieka', 'Organizm', 'Otchłań', 'Pająk', 'Pamięć', 'Pan', 'Panna młoda', 'Państwo', 'Patriota', 'Piekło', 'Pielgrzym', 'Pieniądz', 'Pies', 'Piętno', 'Pijaństwo', 'Piwnica', 'Plotka', 'Pobożność', 'Pocałunek', 'Pochlebstwo', 'Poeta', 'Poetka', 'Poezja', 'Podróż', 'Podstęp', 'Pogrzeb', 'Pojedynek', 'Pokora', 'Pokusa', 'Polak', 'Polityka', 'Polowanie', 'Polska', 'Portret', 'Porwanie', 'Poświęcenie', 'Potwór', 'Powstanie', 'Powstaniec', 'Pozory', 'Pozycja społeczna', 'Pożar', 'Pożądanie', 'Praca', 'Praca u podstaw', 'Praca organiczna', 'Prawda', 'Prawnik', 'Prometeusz', 'Proroctwo', 'Prorok', 'Próżność', 'Przebranie', 'Przeczucie', 'Przedmurze chrześcijaństwa', 'Przekleństwo', 'Przekupstwo', 'Przemiana', 'Przemijanie', 'Przemoc', 'Przestrzeń', 'Przyjaźń', 'Przyroda nieożywiona', 'Przysięga', 'Przywódca', 'Ptak', 'Pustynia', 'Pycha', 'Raj', 'Realista', 'Religia', 'Rewolucja', 'Robak', 'Robotnik', 'Rodzina', 'Rosja', 'Rosjanin', 'Rośliny', 'Rozczarowanie', 'Rozpacz', 'Rozstanie', 'Rozum', 'Ruiny', 'Rycerz', 'Rzeka', 'Salon', 'Samobójstwo', 'Samolubstwo', 'Samotnik', 'Samotność', 'Sarmata', 'Sąsiad', 'Sąd', 'Sąd Ostateczny', 'Sen', 'Serce', 'Sędzia', 'Sielanka', 'Sierota', 'Siła', 'Siostra', 'Sława', 'Słońce', 'Słowo', 'Sługa', 'Służalczość', 'Skąpiec', 'Sobowtór', 'Społecznik', 'Spowiedź', 'Sprawiedliwość', 'Starość', 'Strach', 'Strój', 'Stworzenie', 'Sumienie', 'Swaty', 'Syberia', 'Syn', 'Syn marnotrawny', 'Syzyf', 'Szaleniec', 'Szaleństwo', 'Szantaż', 'Szatan', 'Szczęście', 'Szkoła', 'Szlachcic', 'Szpieg', 'Sztuka', 'Ślub', 'Śmiech', 'Śmierć', 'Śmierć bohaterska', 'Śpiew', 'Światło', 'Świętoszek', 'Święty', 'Świt', 'Tajemnica', 'Taniec', 'Tchórzostwo', 'Teatr', 'Testament', 'Tęsknota', 'Theatrum mundi', 'Tłum', 'Trucizna', 'Trup', 'Twórczość', 'Uczeń', 'Uczta', 'Uroda', 'Umiarkowanie', 'Upadek', 'Upiór', 'Urzędnik', 'Vanitas', 'Walka', 'Walka klas', 'Wampir', 'Warszawa', 'Wąż', 'Wdowa', 'Wdowiec', 'Wesele', 'Wiatr', 'Wierność', 'Wierzenia', 'Wieś', 'Wiedza', 'Wieża Babel', 'Więzienie', 'Więzień', 'Wina', 'Wino', 'Wiosna', 'Wizja', 'Władza', 'Własność', 'Woda', 'Wojna', 'Wojna pokoleń', 'Wolność', 'Wróg', 'Wspomnienia', 'Współpraca', 'Wygnanie', 'Wyrzuty sumienia', 'Wyspa', 'Wzrok', 'Zabawa', 'Zabobony', 'Zamek', 'Zaręczyny', 'Zaświaty', 'Zazdrość', 'Zbawienie', 'Zbrodnia', 'Zbrodniarz', 'Zdrada', 'Zdrowie', 'Zemsta', 'Zesłaniec', 'Ziarno', 'Ziemia', 'Zima', 'Zło', 'Złodziej', 'Złoty wiek', 'Zmartwychwstanie', 'Zwątpienie', 'Zwierzęta', 'Zwycięstwo', 'Żałoba', 'Żebrak', 'Żołnierz', 'Żona', 'Życie jako wędrówka', 'Życie snem', 'Żyd', 'Żywioły', 'Oświadczyny'
+];
+
+$(function()
+{
+       var tabs = $('ol#tabs li');
+       var gallery = null;
+       CurrentDocument = new $.wikiapi.WikiDocument("document-meta");
+
+       $.blockUI.defaults.baseZ = 10000;
+
+    function initialize()
+       {
+               gallery = new $.wiki.ScanGalleryPerspective({
+                       doc: CurrentDocument
+               });
+
+               $(document).keydown(function(event) {
+                       console.log("Received key:", event);
+               });
+
+               /* The save button */
+        $('#save-button').click(function(event){
+            event.preventDefault();
+                       $.wiki.showDialog('#save_dialog');
+        });
+
+               $('.editor').hide();
+
+               /*
+                * TABS
+                */
+        $('#tabs li').live('click', function(event, callback) {
+                       $.wiki.switchToTab(this);
+        });
+
+               $('#tabs li > .tabclose').live('click', function(event, callback) {
+                       var $tab = $(this).parent();
+
+                       if($tab.is('.active'))
+                               $.wiki.switchToTab(DEFAULT_PERSPECTIVE);
+
+                       var p = $.wiki.perspectiveForTab($tab);
+                       p.destroy();
+
+                       return false;
+        });
+
+
+        $(window).resize(function(){
+            $('iframe').height($(window).height() - $('#tabs').outerHeight() - $('#source-editor .toolbar').outerHeight());
+        });
+
+        $(window).resize();
+
+        $('.vsplitbar').toggle(
+                       function() {
+                               $('#side-gallery').show();
+                               $('.vsplitbar').css('right', 480).addClass('.active');
+                               $('#editor .editor').css('right', 510);
+                               $(window).resize();
+                               gallery.onEnter();
+                       },
+                       function() {
+                               $('#side-gallery').hide();
+                               $('.vsplitbar').css('right', 0).removeClass('active');
+                               $('#editor .editor').css('right', 30);
+                               $(window).resize();
+                               gallery.onExit();
+                       }
+               );
+
+        window.onbeforeunload = function(e) {
+            if($.wiki.isDirty()) {
+                               e.returnValue = "Na stronie mogą być nie zapisane zmiany.";
+                               return "Na stronie mogą być nie zapisane zmiany.";
+                       };
+        };
+
+               console.log("Fetching document's text");
+
+               $(document).bind('wlapi_document_changed', function(event, doc) {
+                       try {
+                               $('#document-revision').text(doc.revision);
+                       } catch(e) {
+                               console.log("Failed handler", e);
+                       }
+               });
+
+               CurrentDocument.fetch({
+                       success: function(){
+                               console.log("Fetch success");
+                               $('#loading-overlay').fadeOut();
+                               var active_tab = document.location.hash || DEFAULT_PERSPECTIVE;
+                               var $active = $("#tabs " + active_tab);
+
+                               $active.trigger("click");
+                       },
+                       failure: function() {
+                               $('#loading-overlay').fadeOut();
+                               alert("FAILURE");
+                       }
+               });
+
+               $(window).resize();
+    }; /* end of initialize() */
+
+       var initAll = function(a, f) {
+               if (a.length == 0) return f();
+
+               $.wiki.initTab({
+                       tab: a.pop(),
+                       doc: CurrentDocument,
+                       callback: function(){
+                               initAll(a, f);
+                       }
+               });
+       };
+
+       /*
+        * Initialize all perspectives
+        */
+       initAll( $.makeArray($('ol#tabs li')), initialize);
+       console.log(location.hash);
+});
diff --git a/platforma/static/js/wiki/main.js b/platforma/static/js/wiki/main.js
deleted file mode 100644 (file)
index 9693ce2..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-if (!window.console) {
-    window.console = {
-        log: function(){
-        }
-    }
-}
-
-var DEFAULT_PERSPECTIVE = "#SummaryPerspective";
-
-THEMES = [
-       'Alkohol', 'Ambicja', 'Anioł', 'Antysemityzm', 'Arkadia', 'Artysta', 'Bezdomność', 'Bezpieczeństwo', 'Bieda', 'Bijatyka', 'Błazen', 'Błądzenie', 'Błoto', 'Bogactwo', 'Bóg', 'Brat', 'Bunt', 'Buntownik', 'Burza', 'Car', 'Carpe diem', 'Ciemność', 'Cień', 'Cisza', 'Chciwość', 'Chleb', 'Chłop', 'Choroba', 'Chrystus', 'Chrzest', 'Ciało', 'Cierpienie', 'Cmentarz', 'Cnota', 'Córka', 'Cud', 'Czarownika', 'Czary', 'Czas', 'Czyn', 'Czyściec', 'Dama', 'Danse macabre', 'Deszcz', 'Diabeł', 'Dobro', 'Dom', 'Dorosłość', 'Drzewo', 'Duch', 'Dusza', 'Duma', 'Dworek', 'Dworzanin', 'Dwór', 'Dzieciństwo', 'Dziecko', 'Dziedzictwo', 'Dziewictwo', 'Dźwięk', 'Egzorcyzm', 'Elita', 'Emigrant', 'Fałsz', 'Filozof', 'Fircyk', 'Flirt', 'Głupiec', 'Głupota', 'Głód', 'Gospodarz', 'Gospodyni', 'Gość', 'Gotycyzm', 'Góra', 'Gra', 'Grób', 'Grzech', 'Grzeczność', 'Gwiazda', 'Handel', 'Hańba', 'Historia', 'Honor', 'Idealista', 'Imię', 'Interes', 'Jabłka', 'Jedzenie', 'Jesień', 'Kaleka', 'Kara', 'Karczma', 'Klęska', 'Kłamstwo', 'Kłótnia', 'Kobieta', 'Kobieta demoniczna', 'Kobieta "upadła"', 'Kochanek', 'Kochanek romantyczny', 'Kolonializm', 'Kondycja ludzka', 'Konflikt', 'Konflikt wewnętrzny', 'Koniec świata', 'Koń', 'Korzyść', 'Kot', 'Kradzież', 'Krew', 'Król', 'Krzywda', 'Ksiądz', 'Książka', 'Księżyc', 'Kuchnia', 'Kuszenie', 'Kwiaty', 'Labirynt', 'Las', 'Lato', 'Lekarz', 'Lenistwo', 'List', 'Liberat', 'Los', 'Lud', 'Lustro', 'Łzy', 'Małżeństwo', 'Marzenie', 'Maska', 'Maszyna', 'Matka', 'Matka Boska', 'Mądrość', 'Mąż', 'Melancholia', 'Mędrzec', 'Mężczyzna', 'Miasto', 'Mieszczanin', 'Miłosierdzie', 'Miłość', 'Miłość niespełniona', 'Miłość platoniczna', 'Miłość romantyczna', 'Miłość silniejsza niż śmierć', 'Miłość spełniona', 'Miłość tragiczna', 'Mizoginia', 'Młodość', 'Moda', 'Modlitwa', 'Morderstwo', 'Morze', 'Motyl', 'Mucha', 'Muzyka', 'Narodziny', 'Naród', 'Natura', 'Nauczyciel', 'Nauczycielka', 'Nauka', 'Niebezpieczeństwo', 'Niedziela', 'Niemiec', 'Nienawiść', 'Nieśmiertelność', 'Niewola', 'Noc', 'Nuda', 'Obcy', 'Obłok', 'Obowiązek', 'Obraz świata', 'Obrzędy', 'Obyczaje', 'Obywatel', 'Odrodzenie przez grób', 'Odwaga', 'Ofiara', 'Ogień', 'Ogród', 'Ojciec', 'Ojczyzna', 'Oko', 'Okręt', 'Okrucieństwo', 'Omen', 'Opieka', 'Organizm', 'Otchłań', 'Pająk', 'Pamięć', 'Pan', 'Panna młoda', 'Państwo', 'Patriota', 'Piekło', 'Pielgrzym', 'Pieniądz', 'Pies', 'Piętno', 'Pijaństwo', 'Piwnica', 'Plotka', 'Pobożność', 'Pocałunek', 'Pochlebstwo', 'Poeta', 'Poetka', 'Poezja', 'Podróż', 'Podstęp', 'Pogrzeb', 'Pojedynek', 'Pokora', 'Pokusa', 'Polak', 'Polityka', 'Polowanie', 'Polska', 'Portret', 'Porwanie', 'Poświęcenie', 'Potwór', 'Powstanie', 'Powstaniec', 'Pozory', 'Pozycja społeczna', 'Pożar', 'Pożądanie', 'Praca', 'Praca u podstaw', 'Praca organiczna', 'Prawda', 'Prawnik', 'Prometeusz', 'Proroctwo', 'Prorok', 'Próżność', 'Przebranie', 'Przeczucie', 'Przedmurze chrześcijaństwa', 'Przekleństwo', 'Przekupstwo', 'Przemiana', 'Przemijanie', 'Przemoc', 'Przestrzeń', 'Przyjaźń', 'Przyroda nieożywiona', 'Przysięga', 'Przywódca', 'Ptak', 'Pustynia', 'Pycha', 'Raj', 'Realista', 'Religia', 'Rewolucja', 'Robak', 'Robotnik', 'Rodzina', 'Rosja', 'Rosjanin', 'Rośliny', 'Rozczarowanie', 'Rozpacz', 'Rozstanie', 'Rozum', 'Ruiny', 'Rycerz', 'Rzeka', 'Salon', 'Samobójstwo', 'Samolubstwo', 'Samotnik', 'Samotność', 'Sarmata', 'Sąsiad', 'Sąd', 'Sąd Ostateczny', 'Sen', 'Serce', 'Sędzia', 'Sielanka', 'Sierota', 'Siła', 'Siostra', 'Sława', 'Słońce', 'Słowo', 'Sługa', 'Służalczość', 'Skąpiec', 'Sobowtór', 'Społecznik', 'Spowiedź', 'Sprawiedliwość', 'Starość', 'Strach', 'Strój', 'Stworzenie', 'Sumienie', 'Swaty', 'Syberia', 'Syn', 'Syn marnotrawny', 'Syzyf', 'Szaleniec', 'Szaleństwo', 'Szantaż', 'Szatan', 'Szczęście', 'Szkoła', 'Szlachcic', 'Szpieg', 'Sztuka', 'Ślub', 'Śmiech', 'Śmierć', 'Śmierć bohaterska', 'Śpiew', 'Światło', 'Świętoszek', 'Święty', 'Świt', 'Tajemnica', 'Taniec', 'Tchórzostwo', 'Teatr', 'Testament', 'Tęsknota', 'Theatrum mundi', 'Tłum', 'Trucizna', 'Trup', 'Twórczość', 'Uczeń', 'Uczta', 'Uroda', 'Umiarkowanie', 'Upadek', 'Upiór', 'Urzędnik', 'Vanitas', 'Walka', 'Walka klas', 'Wampir', 'Warszawa', 'Wąż', 'Wdowa', 'Wdowiec', 'Wesele', 'Wiatr', 'Wierność', 'Wierzenia', 'Wieś', 'Wiedza', 'Wieża Babel', 'Więzienie', 'Więzień', 'Wina', 'Wino', 'Wiosna', 'Wizja', 'Władza', 'Własność', 'Woda', 'Wojna', 'Wojna pokoleń', 'Wolność', 'Wróg', 'Wspomnienia', 'Współpraca', 'Wygnanie', 'Wyrzuty sumienia', 'Wyspa', 'Wzrok', 'Zabawa', 'Zabobony', 'Zamek', 'Zaręczyny', 'Zaświaty', 'Zazdrość', 'Zbawienie', 'Zbrodnia', 'Zbrodniarz', 'Zdrada', 'Zdrowie', 'Zemsta', 'Zesłaniec', 'Ziarno', 'Ziemia', 'Zima', 'Zło', 'Złodziej', 'Złoty wiek', 'Zmartwychwstanie', 'Zwątpienie', 'Zwierzęta', 'Zwycięstwo', 'Żałoba', 'Żebrak', 'Żołnierz', 'Żona', 'Życie jako wędrówka', 'Życie snem', 'Żyd', 'Żywioły', 'Oświadczyny'
-];
-
-$(function() 
-{      
-       var tabs = $('ol#tabs li');             
-       var gallery = null;
-       CurrentDocument = new $.wikiapi.WikiDocument("document-meta");
-               
-       $.blockUI.defaults.baseZ = 10000;
-                       
-    function initialize() 
-       {               
-               gallery = new $.wiki.ScanGalleryPerspective({
-                       doc: CurrentDocument
-               });
-               
-               $(document).keydown(function(event) {
-                       console.log("Received key:", event);
-               });
-               
-               /* The save button */
-        $('#save-button').click(function(event){
-            event.preventDefault();
-                       $.wiki.showDialog('#save_dialog');            
-        }); 
-                               
-               $('.editor').hide();   
-               
-               /*
-                * TABS 
-                */             
-        $('#tabs li').live('click', function(event, callback) {
-                       $.wiki.switchToTab(this);                       
-        });
-               
-               $('#tabs li > .tabclose').live('click', function(event, callback) {
-                       var $tab = $(this).parent();
-                       
-                       if($tab.is('.active'))
-                               $.wiki.switchToTab(DEFAULT_PERSPECTIVE);
-                               
-                       var p = $.wiki.perspectiveForTab($tab);
-                       p.destroy();
-                       
-                       return false;                   
-        });
-                       
-        
-        $(window).resize(function(){
-            $('iframe').height($(window).height() - $('#tabs').outerHeight() - $('#source-editor .toolbar').outerHeight());
-        });
-        
-        $(window).resize();
-        
-        $('.vsplitbar').toggle(
-                       function() {
-                               $('#side-gallery').show();
-                               $('.vsplitbar').css('right', 480).addClass('.active');
-                               $('#editor .editor').css('right', 510);
-                               $(window).resize();
-                               gallery.onEnter();
-                       }, 
-                       function() {
-                               $('#side-gallery').hide();
-                               $('.vsplitbar').css('right', 0).removeClass('active');
-                               $('#editor .editor').css('right', 30);
-                               $(window).resize();
-                               gallery.onExit();
-                       }
-               );              
-        
-        window.onbeforeunload = function(e) {
-            if($.wiki.isDirty()) {
-                               e.returnValue = "Na stronie mogą być nie zapisane zmiany.";
-                               return "Na stronie mogą być nie zapisane zmiany.";
-                       };
-        };
-               
-               console.log("Fetching document's text");
-               
-               $(document).bind('wlapi_document_changed', function(event, doc) {
-                       try {
-                               $('#document-revision').text(doc.revision);
-                       } catch(e) {
-                               console.log("Failed handler", e);
-                       }
-               });
-               
-               CurrentDocument.fetch({
-                       success: function(){
-                               console.log("Fetch success");
-                               $('#loading-overlay').fadeOut();                                
-                               var active_tab = document.location.hash || DEFAULT_PERSPECTIVE;
-                               var $active = $("#tabs " + active_tab);
-                               
-                               $active.trigger("click");
-                       },
-                       failure: function() {
-                               $('#loading-overlay').fadeOut();
-                               alert("FAILURE");
-                       }
-               });
-                               
-               $(window).resize();             
-    }; /* end of initialize() */
-       
-       var initAll = function(a, f) {                          
-               if (a.length == 0) return f();  
-                               
-               $.wiki.initTab({
-                       tab: a.pop(),
-                       doc: CurrentDocument,                   
-                       callback: function(){                           
-                               initAll(a, f);
-                       }
-               });                                                             
-       };
-       
-       /*
-        * Initialize all perspectives 
-        */
-       initAll( $.makeArray($('ol#tabs li')), initialize);
-       console.log(location.hash);     
-});
diff --git a/platforma/static/js/wiki/save_dialog.js b/platforma/static/js/wiki/save_dialog.js
deleted file mode 100644 (file)
index 2159a57..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/* 
- * Dialog for saving document to the server
- * 
- */
-(function($) {
-       
-       function SaveDialog(element) {
-               this.ctx = $.wiki.exitContext();
-               this.clearForm();
-               
-               /* fill out hidden fields */
-               this.$form = $('form', element);
-               
-               $("input[name='id']", this.$form).val(CurrentDocument.id);
-               $("input[name='parent_revision']", this.$form).val(CurrentDocument.revision);
-               
-               $.wiki.cls.GenericDialog.call(this, element);           
-       };
-       
-       SaveDialog.prototype = new $.wiki.cls.GenericDialog(); 
-       
-       SaveDialog.prototype.cancelAction = function() {
-               $.wiki.enterContext(this.ctx);
-               this.hide();
-       };
-       
-       SaveDialog.prototype.saveAction = function() {
-                       var self = this;                                
-                       
-                       self.$elem.block({
-                               message: "Zapisywanie...",
-                               fadeIn: 0,
-                       });
-                       
-                       try {
-                               
-                               CurrentDocument.save({
-                                       form: self.$form,
-                                       success: function(doc, changed, info){
-                                               self.$elem.block({
-                                                       message: info,
-                                                       timeout: 2000,
-                                                       fadeOut: 0, 
-                                                       onUnblock: function() {                                                                                                                 
-                                                               self.hide();
-                                                               $.wiki.enterContext(self.ctx);
-                                                       }
-                                               });
-                                       },
-                                       failure: function(doc, info) {
-                                               console.log("Failure", info);
-                                               self.reportErrors(info);
-                                               self.$elem.unblock();
-                                       }                                       
-                               });
-                       } catch(e) {
-                               console.log('Exception:', e)
-                               self.$elem.unblock();
-                       }
-       }; /* end of save dialog */
-       
-       /* make it global */
-       $.wiki.cls.SaveDialog = SaveDialog;     
-})(jQuery);
diff --git a/platforma/static/js/wiki/scan_gallery.js b/platforma/static/js/wiki/scan_gallery.js
deleted file mode 100644 (file)
index 7f646d7..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-(function($){
-
-    function normalizeNumber(pageNumber, pageCount){
-        // Numer strony musi być pomiędzy 1 a najwyższym numerem
-        var pageNumber = parseInt(pageNumber, 10);
-        
-        if (!pageNumber ||
-        pageNumber == NaN ||
-        pageNumber == Infinity ||
-        pageNumber == -Infinity ||
-        pageNumber < 1) 
-            return 1;
-        
-        if (pageNumber > pageCount) 
-            return pageCount;
-        
-        return pageNumber;
-    }
-    
-    function bounds(galleryWidth, galleryHeight, imageWidth, imageHeight){
-        return {
-            maxX: 0,
-            maxY: 0,
-            minX: galleryWidth - imageWidth,
-            minY: galleryHeight - imageHeight
-        }
-    };
-    
-    function normalizePosition(x, y, galleryWidth, galleryHeight, imageWidth, imageHeight){
-        var b = bounds(galleryWidth, galleryHeight, imageWidth, imageHeight);
-        return {
-            x: Math.min(b.maxX, Math.max(b.minX, x)),
-            y: Math.min(b.maxY, Math.max(b.minY, y))
-        }
-    };
-    
-    function fixImageSize(){
-    
-    }
-    
-    /*
-     * Perspective
-     */
-    function ScanGalleryPerspective(options){
-        var old_callback = options.callback || function() { };
-        
-        options.callback = function(){
-            var self = this;
-            
-            this.dimensions = {};
-            this.zoomFactor = 1;
-            this.$element = $("#side-gallery");
-            this.$numberInput = $('.page-number', this.$element);
-            
-            // ...
-            var origin = {};
-            var imageOrigin = {};
-            
-            this.$image = $('.gallery-image img', this.$element).attr('unselectable', 'on');
-            
-            // button handlers
-            this.$numberInput.change(function(event){
-                event.preventDefault();
-                self.setPage($(this).val());
-            });
-            
-            $('.previous-page', this.$element).click(function(){
-                self.setPage(parseInt(self.$numberInput.val(),10) - 1);
-            });
-            
-            $('.next-page', this.$element).click(function(){
-                self.setPage(parseInt(self.$numberInput.val(),10) + 1);
-            });
-            
-            $('.zoom-in', this.$element).click(function(){
-                self.alterZoom(0.2);
-            });
-            
-            $('.zoom-out', this.$element).click(function(){
-                self.alterZoom((-0.2));
-            });
-            
-            $(window).resize(function(){
-                self.dimensions.galleryWidth = self.$image.parent().width();
-                self.dimensions.galleryHeight = self.$image.parent().height();
-            });
-            
-            $('.gallery-image img', this.$element).load(function(){
-                console.log("Image loaded.")
-                self._resizeImage();
-            }).bind('mousedown', function() {
-                               self.imageMoveStart.apply(self, arguments);
-                       });
-            
-                       old_callback.call(this);
-        };
-        
-        $.wiki.Perspective.call(this, options);
-    };
-    
-    ScanGalleryPerspective.prototype = new $.wiki.Perspective();
-    
-    ScanGalleryPerspective.prototype._resizeImage = function(){
-        var $img = this.$image;
-        
-        $img.css({
-            width: null,
-            height: null
-        });
-        
-        this.dimensions = {
-            width: $img.width() * this.zoomFactor,
-            height: $img.height() * this.zoomFactor,
-            originWidth: $img.width(),
-            originHeight: $img.height(),          
-                   galleryWidth: $img.parent().width(),
-            galleryHeight: $img.parent().height()
-        };
-        
-        if (!(this.dimensions.width && this.dimensions.height)) {
-            setTimeout(function(){
-                $img.load();
-            }, 100);
-        }
-        
-        var position = normalizePosition($img.position().left, $img.position().top, this.dimensions.galleryWidth, this.dimensions.galleryHeight, this.dimensions.width, this.dimensions.height);
-        
-        $img.css({
-            left: position.x,
-            top: position.y,
-            width: $img.width() * this.zoomFactor,
-            height: $img.height() * this.zoomFactor
-        });
-    };
-    
-    ScanGalleryPerspective.prototype.setPage = function(newPage){
-        newPage = normalizeNumber(newPage, this.doc.galleryImages.length);
-        this.$numberInput.val(newPage);
-        $('.gallery-image img', this.$element).attr('src', this.doc.galleryImages[newPage - 1]);
-    };
-    
-    ScanGalleryPerspective.prototype.alterZoom = function(delta){
-        var zoomFactor = this.zoomFactor + delta;
-        if (zoomFactor < 0.2) 
-            zoomFactor = 0.2;
-        if (zoomFactor > 2) 
-            zoomFactor = 2;
-        this.setZoom(zoomFactor);
-    };
-    
-    ScanGalleryPerspective.prototype.setZoom = function(factor){
-        this.zoomFactor = factor;
-        
-        this.dimensions.width = this.dimensions.originWidth * this.zoomFactor;
-        this.dimensions.height = this.dimensions.originHeight * this.zoomFactor;
-        
-        // var position = normalizePosition(this.$image.position().left, this.$image.position().top, this.dimensions.galleryWidth, this.dimensions.galleryHeight, this.dimensions.width, this.dimensions.height);
-        
-               this._resizeImage();
-        /* this.$image.css({
-            width: this.dimensions.width,
-            height: this.dimensions.height,
-            left: position.x,
-            top: position.y
-        });*/
-    };
-       
-       /*
-        * Movement
-        */
-       ScanGalleryPerspective.prototype.imageMoved = function(event){
-               event.preventDefault();
-               
-               // origin is where the drag started
-               // imageOrigin is where the drag started on the image
-               
-               var newX = event.clientX - this.origin.x + this.imageOrigin.left;
-               var newY = event.clientY - this.origin.y + this.imageOrigin.top;
-               
-               var position = normalizePosition(newX, newY, this.dimensions.galleryWidth, this.dimensions.galleryHeight, this.dimensions.width, this.dimensions.height);
-               
-               this.$image.css({
-                       left: position.x,
-                       top: position.y,
-               });
-               
-               return false;
-       };
-       
-       ScanGalleryPerspective.prototype.imageMoveStart = function(event){
-               event.preventDefault();
-               
-               var self = this;
-               
-               this.origin = {
-                       x: event.clientX,
-                       y: event.clientY
-               };
-               
-               this.imageOrigin = self.$image.position();
-               $(document).bind('mousemove.gallery', function(){
-                       self.imageMoved.apply(self, arguments);
-               }).bind('mouseup.gallery', function() {
-                       self.imageMoveStop.apply(self, arguments); 
-               });
-               
-               return false;
-       };
-       
-       ScanGalleryPerspective.prototype.imageMoveStop = function(event){
-               $(document).unbind('mousemove.gallery').unbind('mouseup.gallery');
-       };
-    
-    /*
-     * Loading gallery
-     */
-    ScanGalleryPerspective.prototype.onEnter = function(success, failure){
-        var self = this;
-        
-        $.wiki.Perspective.prototype.onEnter.call(this);
-        
-        this.doc.refreshGallery({
-            success: function(doc, data){
-                self.$image.show();
-                               self.setPage( self.$numberInput.val() );
-                               
-                $('.error_message', self.$element).hide();
-                if(success) success();
-            },
-            failure: function(doc, message){
-                self.$image.hide();
-                $('.error_message', self.$element).show().html(message);
-                if(failure) failure();
-            }
-        });
-    };
-    
-    $.wiki.ScanGalleryPerspective = ScanGalleryPerspective;
-       
-})(jQuery);
\ No newline at end of file
diff --git a/platforma/static/js/wiki/source_editor.js b/platforma/static/js/wiki/source_editor.js
deleted file mode 100644 (file)
index 9cfa510..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/* COMMENT */
-(function($) {
-       
-       function CodeMirrorPerspective(options) 
-       {
-               var old_callback = options.callback;        
-        options.callback = function(){         
-                       var self = this;
-                       
-                       this.codemirror = CodeMirror.fromTextArea('codemirror_placeholder', {
-                               parserfile: 'parsexml.js',
-                               path: STATIC_URL + "js/lib/codemirror/",
-                               stylesheet: STATIC_URL + "css/xmlcolors_15032010.css",
-                               parserConfig: {
-                                       useHTMLKludges: false
-                               },
-                               iframeClass: 'xml-iframe',
-                               textWrapping: true,
-                               lineNumbers: false,
-                               width: "100%",
-                               tabMode: 'spaces',
-                               indentUnit: 0,
-                               initCallback: function(){
-                                       
-                                        self.codemirror.grabKeys(function(event) {                     
-                                               if (event.button) {
-                                                       $(event.button).trigger('click');
-                                                       event.button = null;
-                                               }
-                                       }, function(event) {
-                                               /* CM reports characters 2 times - as event and as code */  
-                                               if((typeof event) != "object")
-                                                       return false;
-                                                       
-                                               if(!event.altKey)
-                                                       return false;   
-                                               
-                                               var c = String.fromCharCode(event.keyCode).toLowerCase();                                                       
-                                               var button = $("#source-editor button[data-ui-accesskey='"+c+"']");                                             
-                                               if(button.length == 0)
-                                                       return false;
-                                                       
-                                               /* it doesn't matter which button we pick - all do the same */
-                                               event.button = button[0];
-                                               return true;                                                                    
-                                       }); 
-                                       
-                                       $('#source-editor .toolbar button').click(function(event){
-                                               event.preventDefault();
-                                               var params = eval("(" + $(this).attr('data-ui-action-params') + ")");
-                                               scriptletCenter.scriptlets[$(this).attr('data-ui-action')](self.codemirror, params);
-                                       });
-                                       
-                                       $('.toolbar select').change(function(event){
-                                               var slug = $(this).val();
-                                               
-                                               $('.toolbar-buttons-container').hide().filter('[data-group=' + slug + ']').show();
-                                               $(window).resize();
-                                       });
-                                       
-                                       $('.toolbar-buttons-container').hide();
-                                       $('.toolbar select').change();
-                                       
-                                       console.log("Initialized CodeMirror");
-                                       // textarea is no longer needed
-                                       $('codemirror_placeholder').remove();
-                                       old_callback.call(self);
-                               }
-                       });     
-               };
-               
-               $.wiki.Perspective.call(this, options);
-       };
-       
-       
-       CodeMirrorPerspective.prototype = new $.wiki.Perspective();
-       
-       CodeMirrorPerspective.prototype.freezeState = function() {
-               
-       };
-       
-       CodeMirrorPerspective.prototype.onEnter = function(success, failure) {
-               $.wiki.Perspective.prototype.onEnter.call(this);
-       
-               console.log('Entering', this.doc);
-               this.codemirror.setCode(this.doc.text);
-               if(success) success();
-       }
-       
-       CodeMirrorPerspective.prototype.onExit = function(success, failure) {
-               $.wiki.Perspective.prototype.onExit.call(this);
-       
-               console.log('Exiting', this.doc);
-               this.doc.setText(this.codemirror.getCode());
-               if(success) success();
-       }
-       
-       $.wiki.CodeMirrorPerspective = CodeMirrorPerspective;
-               
-})(jQuery);
diff --git a/platforma/static/js/wiki/summary_view.js b/platforma/static/js/wiki/summary_view.js
deleted file mode 100644 (file)
index 35f03f7..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-(function($){
-       
-       function SummaryPerspective(options) {
-               var old_callback = options.callback;        
-        options.callback = function(){
-                       old_callback.call(this);
-               };              
-               
-               $.wiki.Perspective.call(this, options);
-    };
-    
-    SummaryPerspective.prototype = new $.wiki.Perspective();
-    
-    SummaryPerspective.prototype.freezeState = function(){
-        // must 
-    };
-       
-       SummaryPerspective.prototype.onEnter = function(success, failure){
-               $.wiki.Perspective.prototype.onEnter.call(this);
-               
-               console.log("Entered summery view");
-       };
-       
-       $.wiki.SummaryPerspective = SummaryPerspective;
-       
-})(jQuery);
-
diff --git a/platforma/static/js/wiki/view_column_diff.js b/platforma/static/js/wiki/view_column_diff.js
new file mode 100644 (file)
index 0000000..a212f81
--- /dev/null
@@ -0,0 +1,34 @@
+(function($){
+
+       function DiffPerspective(options) {
+               var old_callback = options.callback || function() {};
+               var self = this;
+
+        options.callback = function(){
+                       self.base_id = options.base_id;
+                       old_callback.call(this);
+               };
+
+               $.wiki.Perspective.call(this, options);
+    };
+
+    DiffPerspective.prototype = new $.wiki.Perspective();
+
+    DiffPerspective.prototype.freezeState = function(){
+        // must
+    };
+
+       DiffPerspective.prototype.destroy = function() {
+               $('#' + this.base_id).remove();
+               $('#' + this.perspective_id).remove();
+       };
+
+       DiffPerspective.prototype.onEnter = function(success, failure){
+               $.wiki.Perspective.prototype.onEnter.call(this);
+               console.log("Entered diff view");
+       };
+
+       $.wiki.DiffPerspective = DiffPerspective;
+
+})(jQuery);
+
diff --git a/platforma/static/js/wiki/view_editor_source.js b/platforma/static/js/wiki/view_editor_source.js
new file mode 100644 (file)
index 0000000..9dffaf0
--- /dev/null
@@ -0,0 +1,100 @@
+/* COMMENT */
+(function($) {
+
+       function CodeMirrorPerspective(options)
+       {
+               var old_callback = options.callback;
+        options.callback = function(){
+                       var self = this;
+
+                       this.codemirror = CodeMirror.fromTextArea('codemirror_placeholder', {
+                               parserfile: 'parsexml.js',
+                               path: STATIC_URL + "js/lib/codemirror/",
+                               stylesheet: STATIC_URL + "css/xmlcolors_15032010.css",
+                               parserConfig: {
+                                       useHTMLKludges: false
+                               },
+                               iframeClass: 'xml-iframe',
+                               textWrapping: true,
+                               lineNumbers: false,
+                               width: "100%",
+                               tabMode: 'spaces',
+                               indentUnit: 0,
+                               initCallback: function(){
+
+                                        self.codemirror.grabKeys(function(event) {
+                                               if (event.button) {
+                                                       $(event.button).trigger('click');
+                                                       event.button = null;
+                                               }
+                                       }, function(event) {
+                                               /* CM reports characters 2 times - as event and as code */
+                                               if((typeof event) != "object")
+                                                       return false;
+
+                                               if(!event.altKey)
+                                                       return false;
+
+                                               var c = String.fromCharCode(event.keyCode).toLowerCase();
+                                               var button = $("#source-editor button[data-ui-accesskey='"+c+"']");
+                                               if(button.length == 0)
+                                                       return false;
+
+                                               /* it doesn't matter which button we pick - all do the same */
+                                               event.button = button[0];
+                                               return true;
+                                       });
+
+                                       $('#source-editor .toolbar button').click(function(event){
+                                               event.preventDefault();
+                                               var params = eval("(" + $(this).attr('data-ui-action-params') + ")");
+                                               scriptletCenter.scriptlets[$(this).attr('data-ui-action')](self.codemirror, params);
+                                       });
+
+                                       $('.toolbar select').change(function(event){
+                                               var slug = $(this).val();
+
+                                               $('.toolbar-buttons-container').hide().filter('[data-group=' + slug + ']').show();
+                                               $(window).resize();
+                                       });
+
+                                       $('.toolbar-buttons-container').hide();
+                                       $('.toolbar select').change();
+
+                                       console.log("Initialized CodeMirror");
+                                       // textarea is no longer needed
+                                       $('codemirror_placeholder').remove();
+                                       old_callback.call(self);
+                               }
+                       });
+               };
+
+               $.wiki.Perspective.call(this, options);
+       };
+
+
+       CodeMirrorPerspective.prototype = new $.wiki.Perspective();
+
+       CodeMirrorPerspective.prototype.freezeState = function() {
+
+       };
+
+       CodeMirrorPerspective.prototype.onEnter = function(success, failure) {
+               $.wiki.Perspective.prototype.onEnter.call(this);
+
+               console.log('Entering', this.doc);
+               this.codemirror.setCode(this.doc.text);
+               if(success) success();
+       }
+
+       CodeMirrorPerspective.prototype.onExit = function(success, failure) {
+               $.wiki.Perspective.prototype.onExit.call(this);
+
+               console.log('Exiting', this.doc);
+               this.doc.setText(this.codemirror.getCode());
+               if(success) success();
+       }
+
+       $.wiki.CodeMirrorPerspective = CodeMirrorPerspective;
+
+})(jQuery);
diff --git a/platforma/static/js/wiki/view_editor_wysiwyg.js b/platforma/static/js/wiki/view_editor_wysiwyg.js
new file mode 100644 (file)
index 0000000..177c113
--- /dev/null
@@ -0,0 +1,422 @@
+(function($){
+
+    /* Show theme to the user */
+    function selectTheme(themeId){
+        var selection = window.getSelection();
+        selection.removeAllRanges();
+
+        var range = document.createRange();
+        var s = $(".motyw[theme-class='" + themeId + "']")[0];
+        var e = $(".end[theme-class='" + themeId + "']")[0];
+
+        if (s && e) {
+            range.setStartAfter(s);
+            range.setEndBefore(e);
+            selection.addRange(range);
+        }
+    };
+
+    /* Verify insertion port for annotation or theme */
+    function verifyTagInsertPoint(node){
+        if (node.nodeType == 3) { // Text Node
+            node = node.parentNode;
+        }
+
+        if (node.nodeType != 1) {
+            return false;
+        }
+
+        node = $(node);
+        var xtype = node.attr('x-node');
+
+        if (!xtype || (xtype.search(':') >= 0) ||
+        xtype == 'motyw' ||
+        xtype == 'begin' ||
+        xtype == 'end') {
+            return false;
+        }
+
+        // don't allow themes inside annotations
+        if (node.is('*[x-annotation-box] *'))
+            return false;
+
+        return true;
+    }
+
+    /* Convert HTML frament to plaintext */
+    var ANNOT_ALLOWED = ['wyroznienie', 'slowo_obce', 'osoba'];
+
+    function html2plainText(fragment){
+        var text = "";
+
+        $(fragment.childNodes).each(function(){
+            if (this.nodeType == 3) // textNode
+                text += this.nodeValue;
+            else
+                if (this.nodeType == 1 &&
+                $.inArray($(this).attr('x-node'), ANNOT_ALLOWED) != -1) {
+                    text += html2plainText(this);
+                }
+        });
+
+        return text;
+    }
+
+
+    /* Insert annotation using current selection */
+    function addAnnotation(){
+        var selection = window.getSelection();
+        var n = selection.rangeCount;
+
+        if (n == 0) {
+            window.alert("Nie zaznaczono żadnego obszaru");
+            return false;
+        }
+
+        // for now allow only 1 range
+        if (n > 1) {
+            window.alert("Zaznacz jeden obszar");
+            return false;
+        }
+
+        // remember the selected range
+        var range = selection.getRangeAt(0);
+
+        if (!verifyTagInsertPoint(range.endContainer)) {
+            window.alert("Nie można wstawić w to miejsce przypisu.");
+            return false;
+        }
+
+        // BUG #273 - selected text can contain themes, which should be omited from
+        // defining term
+        var text = html2plainText(range.cloneContents());
+
+        var tag = $('<span></span>');
+        range.collapse(false);
+        range.insertNode(tag[0]);
+
+        xml2html({
+            xml: '<pr><slowo_obce>' + text + '</slowo_obce> --- </pr>',
+            success: function(text){
+                var t = $(text);
+                tag.replaceWith(t);
+                openForEdit(t);
+            },
+            error: function(){
+                tag.remove();
+                alert('Błąd przy dodawaniu przypisu:' + errors);
+            }
+        })
+    }
+
+
+    /* Insert theme using current selection */
+
+    function addTheme(){
+        var selection = window.getSelection();
+        var n = selection.rangeCount;
+
+        if (n == 0) {
+            window.alert("Nie zaznaczono żadnego obszaru");
+            return false;
+        }
+
+        // for now allow only 1 range
+        if (n > 1) {
+            window.alert("Zaznacz jeden obszar.");
+            return false;
+        }
+
+
+        // remember the selected range
+        var range = selection.getRangeAt(0);
+
+
+        if ($(range.startContainer).is('.html-editarea') ||
+        $(range.endContainer).is('.html-editarea')) {
+            window.alert("Motywy można oznaczać tylko na tekście nie otwartym do edycji. \n Zamknij edytowany fragment i spróbuj ponownie.");
+            return false;
+        }
+
+        // verify if the start/end points make even sense -
+        // they must be inside a x-node (otherwise they will be discarded)
+        // and the x-node must be a main text
+        if (!verifyTagInsertPoint(range.startContainer)) {
+            window.alert("Motyw nie może się zaczynać w tym miejscu.");
+            return false;
+        }
+
+        if (!verifyTagInsertPoint(range.endContainer)) {
+            window.alert("Motyw nie może się kończyć w tym miejscu.");
+            return false;
+        }
+
+        var date = (new Date()).getTime();
+        var random = Math.floor(4000000000 * Math.random());
+        var id = ('' + date) + '-' + ('' + random);
+
+        var spoint = document.createRange();
+        var epoint = document.createRange();
+
+        spoint.setStart(range.startContainer, range.startOffset);
+        epoint.setStart(range.endContainer, range.endOffset);
+
+        var mtag, btag, etag, errors;
+
+        // insert theme-ref
+
+        xml2html({
+            xml: '<end id="e' + id + '" />',
+            success: function(text){
+                etag = $('<span></span>');
+                epoint.insertNode(etag[0]);
+                etag.replaceWith(text);
+                xml2html({
+                    xml: '<motyw id="m' + id + '"></motyw>',
+                    success: function(text){
+                        mtag = $('<span></span>');
+                        spoint.insertNode(mtag[0]);
+                        mtag.replaceWith(text);
+                        xml2html({
+                            xml: '<begin id="b' + id + '" />',
+                            success: function(text){
+                                btag = $('<span></span>');
+                                spoint.insertNode(btag[0])
+                                btag.replaceWith(text);
+                                selection.removeAllRanges();
+                                openForEdit($('.motyw[theme-class=' + id + ']'));
+                            }
+                        });
+                    }
+                });
+            }
+        });
+    }
+
+    /* open edition window for selected fragment */
+    function openForEdit($origin){
+        var $box = null
+
+        // annotations overlay their sub box - not their own box //
+        if ($origin.is(".annotation-inline-box")) {
+            $box = $("*[x-annotation-box]", $origin);
+        }
+        else {
+            $box = $origin;
+        }
+
+        var x = $box[0].offsetLeft;
+        var y = $box[0].offsetTop;
+        var w = $box.outerWidth();
+        var h = $box.innerHeight();
+
+        if ($origin.is(".annotation-inline-box")) {
+            w = Math.max(w, 400);
+            h = Math.max(h, 60);
+        }
+
+        // start edition on this node
+        var $overlay = $('<div class="html-editarea"><button class="accept-button">Zapisz</button><button class="delete-button">Usuń</button><textarea></textarea></div>').css({
+            position: 'absolute',
+            height: h,
+            left: x,
+            top: y,
+            width: w
+        }).appendTo($box[0].offsetParent || $box.parent()).show();
+
+        if ($origin.is('.motyw')) {
+            $('textarea', $overlay).autocomplete(THEMES, {
+                autoFill: true,
+                multiple: true,
+                selectFirst: true
+            });
+        }
+
+               if ($origin.is('.motyw')) {
+               $('.delete-button', $overlay).click(function() {
+                               if (window.confirm("Czy jesteś pewien, że chcesz usunąć ten motyw ?")) {
+                                       $('[theme-class=' + $origin.attr('theme-class') + ']').remove();
+                                       $overlay.remove();
+                                       $(document).unbind('click.blur-overlay');
+                                       return false;
+                               };
+            });
+               }
+               else {
+                       $('.delete-button', $overlay).hide();
+               }
+
+
+        var serializer = new XMLSerializer();
+
+        html2text({
+            element: $box[0],
+            stripOuter: true,
+            success: function(text){
+                $('textarea', $overlay).val($.trim(text));
+
+                setTimeout(function(){
+                    $('textarea', $overlay).elastic().focus();
+                }, 50);
+
+                function save(argument){
+                    var nodeName = $box.attr('x-node') || 'pe';
+                    var insertedText = $('textarea', $overlay).val();
+
+                    if ($origin.is('.motyw')) {
+                        insertedText = insertedText.replace(/,\s*$/, '');
+                    }
+
+                    xml2html({
+                        xml: '<' + nodeName + '>' + insertedText + '</' + nodeName + '>',
+                        success: function(element){
+                            $origin.html($(element).html());
+                            $overlay.remove();
+                        },
+                        error: function(text){
+                            $overlay.remove();
+                            alert('Błąd! ' + text);
+                        }
+                    })
+                }
+
+                $('.accept-button', $overlay).click(function(){
+                    save();
+                });
+
+                $(document).bind('click.blur-overlay', function(event){
+                    if ($(event.target).parents('.html-editarea').length > 0) {
+                        return;
+                    }
+                    save();
+
+                    $(document).unbind('click.blur-overlay');
+                });
+
+            },
+            error: function(text){
+                alert('Błąd! ' + text);
+            }
+        });
+    }
+
+    function VisualPerspective(options){
+
+        var old_callback = options.callback;
+
+        options.callback = function() {
+            var element = $("#html-view");
+            var button = $('<button class="edit-button">Edytuj</button>');
+
+            $('#html-view').bind('mousemove', function(event){
+                var editable = $(event.target).closest('*[x-editable]');
+                $('.active', element).not(editable).removeClass('active').children('.edit-button').remove();
+
+                               if (!editable.hasClass('active')) {
+                    editable.addClass('active').append(button);
+                }
+                if (editable.is('.annotation-inline-box')) {
+                    $('*[x-annotation-box]', editable).css({
+                        position: 'absolute',
+                        left: event.clientX - editable.offset().left + 5,
+                        top: event.clientY - editable.offset().top + 5
+                    }).show();
+                }
+                else {
+                    $('*[x-annotation-box]').hide();
+                }
+            });
+
+            $('.motyw').live('click', function(){
+                selectTheme($(this).attr('theme-class'));
+            });
+
+            $('#insert-annotation-button').click(function(){
+                addAnnotation();
+                return false;
+            });
+
+            $('#insert-theme-button').click(function(){
+                addTheme();
+                return false;
+            });
+
+            $('.edit-button').live('click', function(event){
+                event.preventDefault();
+                openForEdit($(this).parent());
+            });
+
+                       old_callback.call(this);
+        };
+
+        $.wiki.Perspective.call(this, options);
+    };
+
+    VisualPerspective.prototype = new $.wiki.Perspective();
+
+    VisualPerspective.prototype.freezeState = function(){
+
+    };
+
+    VisualPerspective.prototype.onEnter = function(success, failure){
+        $.wiki.Perspective.prototype.onEnter.call(this);
+
+        $.blockUI({
+            message: 'Uaktualnianie widoku...'
+        });
+
+        function _finalize(callback){
+            $.unblockUI();
+            if (callback)
+                callback();
+        }
+
+        xml2html({
+            xml: this.doc.text,
+            success: function(element){
+                $('#html-view').html(element);
+                _finalize(success);
+            },
+            error: function(text){
+                var message = $('<pre></pre>');
+                message.text(text);
+                $('#html-view').html('<p class="error">Wystąpił błąd:</p><pre>' +
+                message.html() +
+                '</pre>');
+                _finalize(failure);
+            }
+        });
+    };
+
+    VisualPerspective.prototype.onExit = function(success, failure){
+        var self = this;
+
+        $.blockUI({
+            message: 'Zapisywanie widoku...'
+        });
+
+        function _finalize(callback){
+            $.unblockUI();
+            if (callback)
+                callback();
+        }
+
+        if ($('#html-view .error').length > 0)
+            return _finalize(failure);
+
+        html2text({
+            element: $('#html-view div').get(0),
+            success: function(text){
+                self.doc.setText(text);
+                _finalize(success);
+            },
+            error: function(text){
+                $('#source-editor').html('<p>Wystąpił błąd:</p><pre>' + text + '</pre>');
+                _finalize(failure);
+            }
+        });
+    };
+
+    $.wiki.VisualPerspective = VisualPerspective;
+
+})(jQuery);
diff --git a/platforma/static/js/wiki/view_gallery.js b/platforma/static/js/wiki/view_gallery.js
new file mode 100644 (file)
index 0000000..69761ca
--- /dev/null
@@ -0,0 +1,240 @@
+(function($){
+
+    function normalizeNumber(pageNumber, pageCount){
+        // Numer strony musi być pomiędzy 1 a najwyższym numerem
+        var pageNumber = parseInt(pageNumber, 10);
+
+        if (!pageNumber ||
+        pageNumber == NaN ||
+        pageNumber == Infinity ||
+        pageNumber == -Infinity ||
+        pageNumber < 1)
+            return 1;
+
+        if (pageNumber > pageCount)
+            return pageCount;
+
+        return pageNumber;
+    }
+
+    function bounds(galleryWidth, galleryHeight, imageWidth, imageHeight){
+        return {
+            maxX: 0,
+            maxY: 0,
+            minX: galleryWidth - imageWidth,
+            minY: galleryHeight - imageHeight
+        }
+    };
+
+    function normalizePosition(x, y, galleryWidth, galleryHeight, imageWidth, imageHeight){
+        var b = bounds(galleryWidth, galleryHeight, imageWidth, imageHeight);
+        return {
+            x: Math.min(b.maxX, Math.max(b.minX, x)),
+            y: Math.min(b.maxY, Math.max(b.minY, y))
+        }
+    };
+
+    function fixImageSize(){
+
+    }
+
+    /*
+     * Perspective
+     */
+    function ScanGalleryPerspective(options){
+        var old_callback = options.callback || function() { };
+
+        options.callback = function(){
+            var self = this;
+
+            this.dimensions = {};
+            this.zoomFactor = 1;
+            this.$element = $("#side-gallery");
+            this.$numberInput = $('.page-number', this.$element);
+
+            // ...
+            var origin = {};
+            var imageOrigin = {};
+
+            this.$image = $('.gallery-image img', this.$element).attr('unselectable', 'on');
+
+            // button handlers
+            this.$numberInput.change(function(event){
+                event.preventDefault();
+                self.setPage($(this).val());
+            });
+
+            $('.previous-page', this.$element).click(function(){
+                self.setPage(parseInt(self.$numberInput.val(),10) - 1);
+            });
+
+            $('.next-page', this.$element).click(function(){
+                self.setPage(parseInt(self.$numberInput.val(),10) + 1);
+            });
+
+            $('.zoom-in', this.$element).click(function(){
+                self.alterZoom(0.2);
+            });
+
+            $('.zoom-out', this.$element).click(function(){
+                self.alterZoom((-0.2));
+            });
+
+            $(window).resize(function(){
+                self.dimensions.galleryWidth = self.$image.parent().width();
+                self.dimensions.galleryHeight = self.$image.parent().height();
+            });
+
+            $('.gallery-image img', this.$element).load(function(){
+                console.log("Image loaded.")
+                self._resizeImage();
+            }).bind('mousedown', function() {
+                               self.imageMoveStart.apply(self, arguments);
+                       });
+
+                       old_callback.call(this);
+        };
+
+        $.wiki.Perspective.call(this, options);
+    };
+
+    ScanGalleryPerspective.prototype = new $.wiki.Perspective();
+
+    ScanGalleryPerspective.prototype._resizeImage = function(){
+        var $img = this.$image;
+
+        $img.css({
+            width: null,
+            height: null
+        });
+
+        this.dimensions = {
+            width: $img.width() * this.zoomFactor,
+            height: $img.height() * this.zoomFactor,
+            originWidth: $img.width(),
+            originHeight: $img.height(),
+                   galleryWidth: $img.parent().width(),
+            galleryHeight: $img.parent().height()
+        };
+
+        if (!(this.dimensions.width && this.dimensions.height)) {
+            setTimeout(function(){
+                $img.load();
+            }, 100);
+        }
+
+        var position = normalizePosition($img.position().left, $img.position().top, this.dimensions.galleryWidth, this.dimensions.galleryHeight, this.dimensions.width, this.dimensions.height);
+
+        $img.css({
+            left: position.x,
+            top: position.y,
+            width: $img.width() * this.zoomFactor,
+            height: $img.height() * this.zoomFactor
+        });
+    };
+
+    ScanGalleryPerspective.prototype.setPage = function(newPage){
+        newPage = normalizeNumber(newPage, this.doc.galleryImages.length);
+        this.$numberInput.val(newPage);
+        $('.gallery-image img', this.$element).attr('src', this.doc.galleryImages[newPage - 1]);
+    };
+
+    ScanGalleryPerspective.prototype.alterZoom = function(delta){
+        var zoomFactor = this.zoomFactor + delta;
+        if (zoomFactor < 0.2)
+            zoomFactor = 0.2;
+        if (zoomFactor > 2)
+            zoomFactor = 2;
+        this.setZoom(zoomFactor);
+    };
+
+    ScanGalleryPerspective.prototype.setZoom = function(factor){
+        this.zoomFactor = factor;
+
+        this.dimensions.width = this.dimensions.originWidth * this.zoomFactor;
+        this.dimensions.height = this.dimensions.originHeight * this.zoomFactor;
+
+        // var position = normalizePosition(this.$image.position().left, this.$image.position().top, this.dimensions.galleryWidth, this.dimensions.galleryHeight, this.dimensions.width, this.dimensions.height);
+
+               this._resizeImage();
+        /* this.$image.css({
+            width: this.dimensions.width,
+            height: this.dimensions.height,
+            left: position.x,
+            top: position.y
+        });*/
+    };
+
+       /*
+        * Movement
+        */
+       ScanGalleryPerspective.prototype.imageMoved = function(event){
+               event.preventDefault();
+
+               // origin is where the drag started
+               // imageOrigin is where the drag started on the image
+
+               var newX = event.clientX - this.origin.x + this.imageOrigin.left;
+               var newY = event.clientY - this.origin.y + this.imageOrigin.top;
+
+               var position = normalizePosition(newX, newY, this.dimensions.galleryWidth, this.dimensions.galleryHeight, this.dimensions.width, this.dimensions.height);
+
+               this.$image.css({
+                       left: position.x,
+                       top: position.y,
+               });
+
+               return false;
+       };
+
+       ScanGalleryPerspective.prototype.imageMoveStart = function(event){
+               event.preventDefault();
+
+               var self = this;
+
+               this.origin = {
+                       x: event.clientX,
+                       y: event.clientY
+               };
+
+               this.imageOrigin = self.$image.position();
+               $(document).bind('mousemove.gallery', function(){
+                       self.imageMoved.apply(self, arguments);
+               }).bind('mouseup.gallery', function() {
+                       self.imageMoveStop.apply(self, arguments);
+               });
+
+               return false;
+       };
+
+       ScanGalleryPerspective.prototype.imageMoveStop = function(event){
+               $(document).unbind('mousemove.gallery').unbind('mouseup.gallery');
+       };
+
+    /*
+     * Loading gallery
+     */
+    ScanGalleryPerspective.prototype.onEnter = function(success, failure){
+        var self = this;
+
+        $.wiki.Perspective.prototype.onEnter.call(this);
+
+        this.doc.refreshGallery({
+            success: function(doc, data){
+                self.$image.show();
+                               self.setPage( self.$numberInput.val() );
+
+                $('.error_message', self.$element).hide();
+                if(success) success();
+            },
+            failure: function(doc, message){
+                self.$image.hide();
+                $('.error_message', self.$element).show().html(message);
+                if(failure) failure();
+            }
+        });
+    };
+
+    $.wiki.ScanGalleryPerspective = ScanGalleryPerspective;
+
+})(jQuery);
\ No newline at end of file
diff --git a/platforma/static/js/wiki/view_history.js b/platforma/static/js/wiki/view_history.js
new file mode 100644 (file)
index 0000000..f7f2a28
--- /dev/null
@@ -0,0 +1,144 @@
+(function($){
+
+    function HistoryPerspective(options) {
+               var old_callback = options.callback || function() {};
+
+               options.callback = function() {
+                       var self = this;
+
+                       // first time page is rendered
+               $('#make-diff-button').click(function() {
+                               self.makeDiff();
+                       });
+
+                       $('#tag-changeset-button').click(function() {
+                               self.showTagForm();
+                       });
+
+               $('#changes-list .entry').live('click', function(){
+               var $this = $(this);
+               if ($this.hasClass('selected'))
+                       return $this.removeClass('selected');
+
+               if ($("#changes-list .entry.selected").length < 2)
+                       return $this.addClass('selected');
+               });
+
+           $('#changes-list span.tag').live('click', function(event){
+                   return false;
+               });
+
+               old_callback.call(this);
+               }
+
+               $.wiki.Perspective.call(this, options);
+    };
+
+    HistoryPerspective.prototype = new $.wiki.Perspective();
+
+    HistoryPerspective.prototype.freezeState = function(){
+        // must
+    };
+
+    HistoryPerspective.prototype.onEnter = function(success, failure){
+        $.wiki.Perspective.prototype.onEnter.call(this);
+
+        $.blockUI({
+            message: 'Odświeżanie historii...'
+        });
+
+        function _finalize(s){
+            $.unblockUI();
+
+            if (s) {
+                if (success)
+                    success();
+            }
+            else {
+                if (failure)
+                    failure();
+            }
+        }
+
+        function _failure(doc, message){
+            $('#history-view .message-box').html('Nie udało się odświeżyć historii:' + message).show();
+            _finalize(false);
+        };
+
+        function _success(doc, data){
+            $('#history-view .message-box').hide();
+            var changes_list = $('#changes-list');
+            var $stub = $('#history-view .row-stub');
+            changes_list.html('');
+
+                       var tags = $('select#id_tag option');
+
+            $.each(data, function(){
+                $.wiki.renderStub({
+                                       container: changes_list,
+                                       stub: $stub,
+                                       data: this,
+                                       filters: {
+                                               tag: function(value) {
+                                                       return tags.filter("*[value='"+value+"']").text();
+                                               }
+                                       }
+                               });
+            });
+
+            _finalize(true);
+        };
+
+        return this.doc.fetchHistory({
+            success: _success,
+            failure: _failure
+        });
+    };
+
+       HistoryPerspective.prototype.showTagForm = function(){
+               var selected = $('#changes-list .entry.selected');
+
+               if (selected.length != 1) {
+            window.alert("Musisz dokładnie jedną wersję do oznaczenia.");
+            return;
+        }
+
+               var version = parseInt($("*[data-stub-value='version']", selected[0]).text());
+               $.wiki.showDialog('#add_tag_dialog', {'revision': version});
+       };
+
+       HistoryPerspective.prototype.makeDiff = function() {
+        var changelist = $('#changes-list');
+        var selected = $('.entry.selected', changelist);
+
+        if (selected.length != 2) {
+            window.alert("Musisz zaznaczyć dokładnie dwie wersje do porównania.");
+            return;
+        }
+
+        $.blockUI({
+            message: 'Wczytywanie porównania...'
+        });
+
+               var rev_from = $("*[data-stub-value='version']", selected[1]).text();
+               var rev_to =  $("*[data-stub-value='version']", selected[0]).text();
+
+        return this.doc.fetchDiff({
+            from: rev_from,
+                       to: rev_to,
+            success: function(doc, data){
+                var result = $.wiki.newTab(doc, ''+rev_from +' -> ' + rev_to, 'DiffPerspective');
+
+                               $(result.view).html(data);
+                               $.wiki.switchToTab(result.tab);
+                               $.unblockUI();
+            },
+            failure: function(doc){
+                $.unblockUI();
+            }
+        });
+    };
+
+    $.wiki.HistoryPerspective = HistoryPerspective;
+
+})(jQuery);
diff --git a/platforma/static/js/wiki/view_summary.js b/platforma/static/js/wiki/view_summary.js
new file mode 100644 (file)
index 0000000..f86d975
--- /dev/null
@@ -0,0 +1,27 @@
+(function($){
+
+       function SummaryPerspective(options) {
+               var old_callback = options.callback;
+        options.callback = function(){
+                       old_callback.call(this);
+               };
+
+               $.wiki.Perspective.call(this, options);
+    };
+
+    SummaryPerspective.prototype = new $.wiki.Perspective();
+
+    SummaryPerspective.prototype.freezeState = function(){
+        // must
+    };
+
+       SummaryPerspective.prototype.onEnter = function(success, failure){
+               $.wiki.Perspective.prototype.onEnter.call(this);
+
+               console.log("Entered summery view");
+       };
+
+       $.wiki.SummaryPerspective = SummaryPerspective;
+
+})(jQuery);
+
index 9bf5555..ac4c5b1 100644 (file)
 (function($) {
-       
+
        $.wikiapi = {};
-       
        var noop = function() {};
-       var noops = {'success': noop, 'failure': noop};
-       
+       var noops = {success: noop, failure: noop};
+
        /*
         * Return absolute reverse path of given named view.
         * (at least he have it hard-coded in one place)
-        * 
-        * TODO: think of a way, not to hard-code it here ;) 
-        * 
+        *
+        * TODO: think of a way, not to hard-code it here ;)
+        *
         */
-       function reverse() {
+        function reverse() {
                var vname = arguments[0];
-                       
+
                if(vname == "ajax_document_text") {
                        var path = "/" + arguments[1] + "/text";
-                       if (arguments[2] !== undefined) 
+                       if (arguments[2] !== undefined)
                                path += "/" + arguments[2];
                        return path;
                }
-                       
+
                if (vname == "ajax_document_history") {
                        return "/" + arguments[1] + "/history";
                }
-               
+
                if (vname == "ajax_document_gallery") {
                        return "/gallery/" + arguments[1];
-               }                                               
-                                       
+               }
+
                if(vname == "ajax_document_diff")
-                       return "/" + arguments[1] + "/diff"; 
-                       
+                       return "/" + arguments[1] + "/diff";
+
+               if(vname == "ajax_document_addtag")
+                       return "/" + arguments[1] + "/tags";
+
                console.log("Couldn't reverse match:", vname);
-               return "/404.html";             
+               return "/404.html";
        };
-       
+
        /*
-        * Document Abstraction  
+        * Document Abstraction
         */
        function WikiDocument(element_id) {
                var meta = $('#'+element_id);
-               
-               this.id = meta.attr('data-document-name');              
+
+               this.id = meta.attr('data-document-name');
                this.revision = $("*[data-key='revision']", meta).text();
                this.galleryLink = $("*[data-key='gallery']", meta).text();
                this.galleryImages = [];
                this.text = null;
-               
+
                this.has_local_changes = false;
                this._lock = -1;
                this._context_lock = -1;
-               this._lock_count = 0; 
-       }
-       
-//     WikiDocument.prototype.lock = function() {
-//             if(this._lock < 0) {
-//                     this._lock = Math.random();
-//                     this._context_lock = this._lock;
-//                     this._lock_count = 1;
-//                     return this._lock;
-//             }
-//             
-//             // reentrant locks 
-//             if(this._context_lock === this._lock) {
-//                     this._lock_count += 1;
-//                     return this._lock;
-//             }
-//             
-//             throw "Document operation in progress. Try again later."
-//     };
-//             
-//     WikiDocument.prototype.unlock = function(lockNumber) {
-//             if(this.locked === lockNumber) {
-//                     this._lock_count -= 1;
-//                     
-//                     if(this._lock_count === 0) {
-//                             this._lock = -1;
-//                             this._context_lock = -1;
-//                     };                      
-//                     return;
-//             }
-//             throw "Trying to unlock with wrong lockNumber";
-//     };
-//     
-//     /*
-//      * About to leave context of current lock.
-//      */
-//     WikiDocument.prototype.leaveContext = function() {
-//             var old = this._context_lock;
-//             this._context_lock = -1;
-//             return old;
-//     };
+               this._lock_count = 0;
+       };
+
 
        WikiDocument.prototype.triggerDocumentChanged = function() {
-               $(document).trigger('wlapi_document_changed', this);            
+               $(document).trigger('wlapi_document_changed', this);
        };
-       
+
        /*
         * Fetch text of this document.
         */
-       WikiDocument.prototype.fetch = function(params) {               
+       WikiDocument.prototype.fetch = function(params) {
                params = $.extend({}, noops, params);
                var self = this;
-               
+
                $.ajax({
                        method: "GET",
                        url: reverse("ajax_document_text", self.id),
-                       dataType: 'json', 
-                       success: function(data) 
+                       dataType: 'json',
+                       success: function(data)
                        {
                                var changed = false;
-                               
+
                                if (self.text === null || self.revision !== data.revision) {
                                        self.text = data.text;
                                        self.revision = data.revision;
-                                       self.gallery = data.gallery;                                    
+                                       self.gallery = data.gallery;
                                        changed = true;
-                                       self.triggerDocumentChanged();          
-                               }
-                               
-                               self.has_local_changes = false;                         
+                                       self.triggerDocumentChanged();
+                               };
+
+                               self.has_local_changes = false;
                                params['success'](self, changed);
                        },
-                       error: function() {             
+                       error: function() {
                                params['failure'](self, "Nie udało się wczytać treści dokumentu.");
                        }
-               });                                             
+               });
        };
-       
+
        /*
         * Fetch history of this document.
-        * 
+        *
         * from - First revision to fetch (default = 0)
         * upto - Last revision to fetch (default = tip)
-        * 
+        *
         */
-       WikiDocument.prototype.fetchHistory = function(params) {                
-               /* this doesn't modify anything, so no locks */         
-               params = $.extend({}, noops, params);           
+       WikiDocument.prototype.fetchHistory = function(params) {
+               /* this doesn't modify anything, so no locks */
+               params = $.extend({}, noops, params);
                var self = this;
-               
-               $.ajax({                        
+
+               $.ajax({
                        method: "GET",
                        url: reverse("ajax_document_history", self.id),
                        dataType: 'json',
                        error: function() {
                                params['failure'](self, "Nie udało się wczytać historii dokumentu.");
                        }
-               });                                             
+               });
        };
-       
-       WikiDocument.prototype.fetchDiff = function(params) {           
+
+       WikiDocument.prototype.fetchDiff = function(params) {
                /* this doesn't modify anything, so no locks */
                var self = this;
-                               
+
                params = $.extend({
-                       'from': self.revision, 
+                       'from': self.revision,
                        'to': self.revision
                }, noops, params);
-                                       
-               $.ajax({                        
+
+               $.ajax({
                        method: "GET",
                        url: reverse("ajax_document_diff", self.id),
                        dataType: 'html',
                        error: function() {
                                params['failure'](self, "Nie udało się wczytać porównania wersji.");
                        }
-               });                                             
+               });
        };
-       
-       /* 
+
+       /*
         * Fetch gallery
         */
        WikiDocument.prototype.refreshGallery = function(params) {
-               params = $.extend({}, noops, params);           
+               params = $.extend({}, noops, params);
                var self = this;
-               
-               $.ajax({                        
+
+               $.ajax({
                        method: "GET",
                        url: reverse("ajax_document_gallery", self.galleryLink),
                        dataType: 'json',
                        // data: {},
                        success: function(data) {
                                self.galleryImages = data;
-                               params['success'](self, data);                          
+                               params['success'](self, data);
                        },
                        error: function() {
-                               self.galleryImages = [];        
-                               params['failure'](self, "<p>Nie udało się wczytać gallerii pod nazwą: '"
-                                       + self.galleryLink + "'.</p>");
-                                                       
+                               self.galleryImages = [];
+                               params['failure'](self, "<p>Nie udało się wczytać gallerii pod nazwą: '" + self.galleryLink + "'.</p>");
                        }
-               });                             
-       };      
-       
+               });
+       };
+
        /*
         * Set document's text
         */
-       WikiDocument.prototype.setText = function(text) {               
+       WikiDocument.prototype.setText = function(text) {
                this.text = text;
-               this.has_local_changes = true;                                  
+               this.has_local_changes = true;
        };
-       
+
        /*
         * Set document's gallery link
         */
-       WikiDocument.prototype.setGalleryLink = function(gallery) {                             
+       WikiDocument.prototype.setGalleryLink = function(gallery) {
                this.galleryLink = gallery;
-               this.has_local_changes = true;                  
+               this.has_local_changes = true;
        };
-       
+
        /*
         * Save text back to the server
         */
        WikiDocument.prototype.save = function(params){
                params = $.extend({}, noops, params);
                var self = this;
-                               
+
                if (!self.has_local_changes) {
                        console.log("Abort: no changes.");
                        return params['success'](self, false, "Nie ma zmian do zapisania.");
-               };              
-               
+               };
+
                // Serialize form to dictionary
-               var data = {};          
+               var data = {};
                $.each(params['form'].serializeArray(), function() {
-                       data[this.name] = this.value;                   
+                       data[this.name] = this.value;
                });
-               
+
                var metaComment = '<!--';
                metaComment += '\n\tgallery:' + self.galleryLink;
                metaComment += '\n-->\n'
-               
+
                data.text = metaComment + self.text;
-               data.comment = data.comment; 
-               
+               data.comment = data.comment;
+
                $.ajax({
                        url: reverse("ajax_document_text", self.id),
                        type: "POST",
                                        changed = true;
                                        self.triggerDocumentChanged();
                                }
-                               params['success'](self, changed, 
+                               params['success'](self, changed,
                                        ((changed && "Udało się zapisać :)") || "Twoja wersja i serwera jest identyczna") );
                        },
                        error: function(xhr) {
-                               try {                                    
+                               try {
                                        params['failure'](self, $.parseJSON(xhr.responseText));
-                               } 
+                               }
                                catch(e) {
-                                       params['failure'](self, {"__message": "<p>Nie udało się zapisać - błąd serwera.</p>"});                            
+                                       params['failure'](self, {"__message": "<p>Nie udało się zapisać - błąd serwera.</p>"});
                                };
                        }
-               });             
+               });
        }; /* end of save() */
-       
+
        WikiDocument.prototype.setTag = function(params) {
-               
+               params = $.extend({}, noops, params);
+               var self = this;
+
+               var data = {
+                       "id": self.id,
+               };
+
+               /* unpack form */
+               $.each(params.form.serializeArray(), function() {
+                       data[this.name] = this.value;
+               });
+
+               $.ajax({
+                       url: reverse("ajax_document_addtag", self.id),
+                       type: "POST",
+                       dataType: "json",
+                       data: data,
+                       success: function(data){
+                               params.success(self, data.message);
+                       },
+                       error: function(xhr) {
+                               if (xhr.status == 403 || xhr.status == 401) {
+                                       params.failure(self, {
+                                               "__all__": ["Nie masz uprawnień lub nie jesteś zalogowany."]
+                                       });
+                               }
+                               else {
+                                       try {
+                                               params.failure(self, $.parseJSON(xhr.responseText));
+                                       }
+                                       catch (e) {
+                                               params.failure(self, {
+                                                       "__all__": ["Nie udało się - błąd serwera."]
+                                               });
+                                       };
+                               };
+                       }
+               });
        };
-       
-       
+
        $.wikiapi.WikiDocument = WikiDocument;
-       
+
 })(jQuery);
diff --git a/platforma/static/js/wiki/wysiwyg_editor.js b/platforma/static/js/wiki/wysiwyg_editor.js
deleted file mode 100644 (file)
index eba8695..0000000
+++ /dev/null
@@ -1,422 +0,0 @@
-(function($){
-
-    /* Show theme to the user */
-    function selectTheme(themeId){
-        var selection = window.getSelection();
-        selection.removeAllRanges();
-        
-        var range = document.createRange();
-        var s = $(".motyw[theme-class='" + themeId + "']")[0];
-        var e = $(".end[theme-class='" + themeId + "']")[0];
-        
-        if (s && e) {
-            range.setStartAfter(s);
-            range.setEndBefore(e);
-            selection.addRange(range);
-        }
-    };
-    
-    /* Verify insertion port for annotation or theme */
-    function verifyTagInsertPoint(node){
-        if (node.nodeType == 3) { // Text Node
-            node = node.parentNode;
-        }
-        
-        if (node.nodeType != 1) {
-            return false;
-        }
-        
-        node = $(node);
-        var xtype = node.attr('x-node');
-        
-        if (!xtype || (xtype.search(':') >= 0) ||
-        xtype == 'motyw' ||
-        xtype == 'begin' ||
-        xtype == 'end') {
-            return false;
-        }
-        
-        // don't allow themes inside annotations
-        if (node.is('*[x-annotation-box] *')) 
-            return false;
-        
-        return true;
-    }
-    
-    /* Convert HTML frament to plaintext */
-    var ANNOT_ALLOWED = ['wyroznienie', 'slowo_obce', 'osoba'];
-    
-    function html2plainText(fragment){
-        var text = "";
-        
-        $(fragment.childNodes).each(function(){
-            if (this.nodeType == 3) // textNode
-                text += this.nodeValue;
-            else 
-                if (this.nodeType == 1 &&
-                $.inArray($(this).attr('x-node'), ANNOT_ALLOWED) != -1) {
-                    text += html2plainText(this);
-                }
-        });
-        
-        return text;
-    }
-    
-    
-    /* Insert annotation using current selection */
-    function addAnnotation(){
-        var selection = window.getSelection();
-        var n = selection.rangeCount;
-        
-        if (n == 0) {
-            window.alert("Nie zaznaczono żadnego obszaru");
-            return false;
-        }
-        
-        // for now allow only 1 range
-        if (n > 1) {
-            window.alert("Zaznacz jeden obszar");
-            return false;
-        }
-        
-        // remember the selected range
-        var range = selection.getRangeAt(0);
-        
-        if (!verifyTagInsertPoint(range.endContainer)) {
-            window.alert("Nie można wstawić w to miejsce przypisu.");
-            return false;
-        }
-        
-        // BUG #273 - selected text can contain themes, which should be omited from
-        // defining term
-        var text = html2plainText(range.cloneContents());
-        
-        var tag = $('<span></span>');
-        range.collapse(false);
-        range.insertNode(tag[0]);
-        
-        xml2html({
-            xml: '<pr><slowo_obce>' + text + '</slowo_obce> --- </pr>',
-            success: function(text){
-                var t = $(text);
-                tag.replaceWith(t);
-                openForEdit(t);
-            },
-            error: function(){
-                tag.remove();
-                alert('Błąd przy dodawaniu przypisu:' + errors);
-            }
-        })
-    }
-    
-    
-    /* Insert theme using current selection */
-    
-    function addTheme(){
-        var selection = window.getSelection();
-        var n = selection.rangeCount;
-        
-        if (n == 0) {
-            window.alert("Nie zaznaczono żadnego obszaru");
-            return false;
-        }
-        
-        // for now allow only 1 range
-        if (n > 1) {
-            window.alert("Zaznacz jeden obszar.");
-            return false;
-        }
-        
-        
-        // remember the selected range
-        var range = selection.getRangeAt(0);
-        
-        
-        if ($(range.startContainer).is('.html-editarea') ||
-        $(range.endContainer).is('.html-editarea')) {
-            window.alert("Motywy można oznaczać tylko na tekście nie otwartym do edycji. \n Zamknij edytowany fragment i spróbuj ponownie.");
-            return false;
-        }
-        
-        // verify if the start/end points make even sense -
-        // they must be inside a x-node (otherwise they will be discarded)
-        // and the x-node must be a main text
-        if (!verifyTagInsertPoint(range.startContainer)) {
-            window.alert("Motyw nie może się zaczynać w tym miejscu.");
-            return false;
-        }
-        
-        if (!verifyTagInsertPoint(range.endContainer)) {
-            window.alert("Motyw nie może się kończyć w tym miejscu.");
-            return false;
-        }
-        
-        var date = (new Date()).getTime();
-        var random = Math.floor(4000000000 * Math.random());
-        var id = ('' + date) + '-' + ('' + random);
-        
-        var spoint = document.createRange();
-        var epoint = document.createRange();
-        
-        spoint.setStart(range.startContainer, range.startOffset);
-        epoint.setStart(range.endContainer, range.endOffset);
-        
-        var mtag, btag, etag, errors;
-        
-        // insert theme-ref
-        
-        xml2html({
-            xml: '<end id="e' + id + '" />',
-            success: function(text){
-                etag = $('<span></span>');
-                epoint.insertNode(etag[0]);
-                etag.replaceWith(text);
-                xml2html({
-                    xml: '<motyw id="m' + id + '"></motyw>',
-                    success: function(text){
-                        mtag = $('<span></span>');
-                        spoint.insertNode(mtag[0]);
-                        mtag.replaceWith(text);
-                        xml2html({
-                            xml: '<begin id="b' + id + '" />',
-                            success: function(text){
-                                btag = $('<span></span>');
-                                spoint.insertNode(btag[0])
-                                btag.replaceWith(text);
-                                selection.removeAllRanges();
-                                openForEdit($('.motyw[theme-class=' + id + ']'));
-                            }
-                        });
-                    }
-                });
-            }
-        });
-    }
-    
-    /* open edition window for selected fragment */
-    function openForEdit($origin){
-        var $box = null
-        
-        // annotations overlay their sub box - not their own box //
-        if ($origin.is(".annotation-inline-box")) {
-            $box = $("*[x-annotation-box]", $origin);
-        }
-        else {
-            $box = $origin;
-        }
-        
-        var x = $box[0].offsetLeft;
-        var y = $box[0].offsetTop;
-        var w = $box.outerWidth();
-        var h = $box.innerHeight();
-        
-        if ($origin.is(".annotation-inline-box")) {
-            w = Math.max(w, 400);
-            h = Math.max(h, 60);
-        }
-        
-        // start edition on this node
-        var $overlay = $('<div class="html-editarea"><button class="accept-button">Zapisz</button><button class="delete-button">Usuń</button><textarea></textarea></div>').css({
-            position: 'absolute',
-            height: h,
-            left: x,
-            top: y,
-            width: w
-        }).appendTo($box[0].offsetParent || $box.parent()).show();
-        
-        if ($origin.is('.motyw')) {
-            $('textarea', $overlay).autocomplete(THEMES, {
-                autoFill: true,
-                multiple: true,
-                selectFirst: true
-            });
-        }
-        
-               if ($origin.is('.motyw')) {
-               $('.delete-button', $overlay).click(function() {
-                               if (window.confirm("Czy jesteś pewien, że chcesz usunąć ten motyw ?")) {
-                                       $('[theme-class=' + $origin.attr('theme-class') + ']').remove();
-                                       $overlay.remove();
-                                       $(document).unbind('click.blur-overlay');
-                                       return false;
-                               };
-            });
-               }
-               else {
-                       $('.delete-button', $overlay).hide();
-               }
-        
-        
-        var serializer = new XMLSerializer();
-        
-        html2text({
-            element: $box[0],
-            stripOuter: true,
-            success: function(text){
-                $('textarea', $overlay).val($.trim(text));
-                
-                setTimeout(function(){
-                    $('textarea', $overlay).elastic().focus();
-                }, 50);
-                
-                function save(argument){
-                    var nodeName = $box.attr('x-node') || 'pe';
-                    var insertedText = $('textarea', $overlay).val();
-                    
-                    if ($origin.is('.motyw')) {
-                        insertedText = insertedText.replace(/,\s*$/, '');
-                    }
-                    
-                    xml2html({
-                        xml: '<' + nodeName + '>' + insertedText + '</' + nodeName + '>',
-                        success: function(element){
-                            $origin.html($(element).html());
-                            $overlay.remove();
-                        },
-                        error: function(text){
-                            $overlay.remove();
-                            alert('Błąd! ' + text);
-                        }
-                    })
-                }
-                
-                $('.accept-button', $overlay).click(function(){
-                    save();
-                });
-                
-                $(document).bind('click.blur-overlay', function(event){
-                    if ($(event.target).parents('.html-editarea').length > 0) {
-                        return;
-                    }
-                    save();
-                    
-                    $(document).unbind('click.blur-overlay');
-                });
-                
-            },
-            error: function(text){
-                alert('Błąd! ' + text);
-            }
-        });
-    }
-    
-    function VisualPerspective(options){
-               
-        var old_callback = options.callback;
-               
-        options.callback = function() {       
-            var element = $("#html-view");
-            var button = $('<button class="edit-button">Edytuj</button>');
-            
-            $('#html-view').bind('mousemove', function(event){
-                var editable = $(event.target).closest('*[x-editable]');
-                $('.active', element).not(editable).removeClass('active').children('.edit-button').remove();
-                
-                               if (!editable.hasClass('active')) {
-                    editable.addClass('active').append(button);
-                }
-                if (editable.is('.annotation-inline-box')) {
-                    $('*[x-annotation-box]', editable).css({
-                        position: 'absolute',
-                        left: event.clientX - editable.offset().left + 5,
-                        top: event.clientY - editable.offset().top + 5
-                    }).show();
-                }
-                else {
-                    $('*[x-annotation-box]').hide();
-                }
-            });
-            
-            $('.motyw').live('click', function(){
-                selectTheme($(this).attr('theme-class'));
-            });
-            
-            $('#insert-annotation-button').click(function(){
-                addAnnotation();
-                return false;
-            });
-            
-            $('#insert-theme-button').click(function(){
-                addTheme();
-                return false;
-            });
-            
-            $('.edit-button').live('click', function(event){
-                event.preventDefault();
-                openForEdit($(this).parent());
-            });
-                       
-                       old_callback.call(this);
-        };
-        
-        $.wiki.Perspective.call(this, options);
-    };
-    
-    VisualPerspective.prototype = new $.wiki.Perspective();
-    
-    VisualPerspective.prototype.freezeState = function(){
-    
-    };
-    
-    VisualPerspective.prototype.onEnter = function(success, failure){
-        $.wiki.Perspective.prototype.onEnter.call(this);
-        
-        $.blockUI({
-            message: 'Uaktualnianie widoku...'
-        });
-        
-        function _finalize(callback){
-            $.unblockUI();
-            if (callback) 
-                callback();
-        }
-        
-        xml2html({
-            xml: this.doc.text,
-            success: function(element){
-                $('#html-view').html(element);
-                _finalize(success);
-            },
-            error: function(text){
-                var message = $('<pre></pre>');
-                message.text(text);
-                $('#html-view').html('<p class="error">Wystąpił błąd:</p><pre>' +
-                message.html() +
-                '</pre>');
-                _finalize(failure);
-            }
-        });
-    };
-    
-    VisualPerspective.prototype.onExit = function(success, failure){
-        var self = this;
-        
-        $.blockUI({
-            message: 'Zapisywanie widoku...'
-        });
-        
-        function _finalize(callback){
-            $.unblockUI();
-            if (callback) 
-                callback();
-        }
-        
-        if ($('#html-view .error').length > 0) 
-            return _finalize(failure);
-        
-        html2text({
-            element: $('#html-view div').get(0),
-            success: function(text){
-                self.doc.setText(text);
-                _finalize(success);
-            },
-            error: function(text){
-                $('#source-editor').html('<p>Wystąpił błąd:</p><pre>' + text + '</pre>');
-                _finalize(failure);
-            }
-        });
-    };
-    
-    $.wiki.VisualPerspective = VisualPerspective;
-    
-})(jQuery);
index 566b0a8..dda12a1 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * 
+ *
  * XSLT STUFF
- * 
+ *
  */
 function createXSLT(xsl) {
     var p = new XSLTProcessor();
@@ -12,8 +12,8 @@ function createXSLT(xsl) {
 var xml2htmlStylesheet = null;
 
 // Wykonuje block z załadowanymi arkuszami stylów
-function withStylesheets(code_block, onError) 
-{      
+function withStylesheets(code_block, onError)
+{
     if (!xml2htmlStylesheet) {
        $.blockUI({message: 'Ładowanie arkuszy stylów...'});
        $.ajax({
@@ -23,7 +23,7 @@ function withStylesheets(code_block, onError)
                xml2htmlStylesheet = createXSLT(data);
                 $.unblockUI();
                                code_block();
-                 
+
             },
                        error: onError
         })
@@ -36,27 +36,27 @@ function withStylesheets(code_block, onError)
 
 function xml2html(options) {
     withStylesheets(function() {
-        var xml = options.xml.replace(/\/\s+/g, '<br />');                             
+        var xml = options.xml.replace(/\/\s+/g, '<br />');
         var parser = new DOMParser();
         var serializer = new XMLSerializer();
-        var doc = parser.parseFromString(xml, 'text/xml');             
+        var doc = parser.parseFromString(xml, 'text/xml');
         var error = $('parsererror', doc);
-        
+
         if (error.length == 0) {
             doc = xml2htmlStylesheet.transformToFragment(doc, document);
                        console.log(doc.firstChild);
-                       
+
                        if(doc.firstChild === null) {
                                options.error("Błąd w przetwarzaniu XML.");
                                return;
                        }
-                               
+
             error = $('parsererror', doc);
         }
-        
+
         if (error.length > 0 && options.error) {
             options.error(error.text());
-        } else {                       
+        } else {
             options.success(doc.firstChild);
         }
     }, function() { options.error && options.error('Nie udało się załadować XSLT'); });
@@ -105,46 +105,46 @@ const PADDING = {
     naglowek_rozdzial: 4,
     naglowek_osoba: 4,
     lista_osob: 4,
-    
+
     akap: 3,
     akap_cd: 3,
     akap_dialog: 3,
     strofa: 3,
-    motto: 3, 
+    motto: 3,
     miejsce_czas: 3,
-        
+
     autor_utworu: 2,
     nazwa_utworu: 2,
     dzielo_nadrzedne: 2,
-       
+
     didaskalia: 2,
     motto_podpis: 2,
     naglowek_listy: 2,
     kwestia: 1,
     lista_osoba: 1,
-       
-       "podpis": 1,    
+
+       "podpis": 1,
        "wers": 0,
        "wers_cd": 0,
        "wers_akap": 0,
-       "wers_wciety": 0,       
-       
+       "wers_wciety": 0,
+
        "rdf:RDF": 3,
-       "rdf:Description": 1,   
+       "rdf:Description": 1,
 };
 
 function getPadding(name) {
-       
+
        if(name.match(/^dc:.*$/))
                return -1;
-       
+
        if(PADDING[name])
                return PADDING[name];
-               
+
        return 0;
 }
 
-function HTMLSerializer() {    
+function HTMLSerializer() {
        // empty constructor
 }
 
@@ -152,99 +152,99 @@ function HTMLSerializer() {
 
 HTMLSerializer.prototype._prepare = function() {
        this.stack = [];
-       
+
        // XML namespace is implicit
        this.nsMap = {"http://www.w3.org/XML/1998/namespace": "xml"};
-               
+
        this.result = "";
-       this.nsCounter = 1;     
+       this.nsCounter = 1;
 }
 
 HTMLSerializer.prototype._pushElement = function(element) {
        this.stack.push({
                "type": ELEM_START,
                "node": element
-       });     
+       });
 }
 
 HTMLSerializer.prototype._pushChildren = function(element) {
        for(var i = element.childNodes.length-1; i >= 0; i--)
-               this._pushElement(element.childNodes.item(i));                                  
+               this._pushElement(element.childNodes.item(i));
 }
 
 HTMLSerializer.prototype._pushTagEnd = function(tagName) {
        this.stack.push({
                "type": ELEM_END,
                "tagName": tagName
-       });     
+       });
 }
 
 HTMLSerializer.prototype._verseBefore = function(node) {
        var prev = node.previousSibling;
-       
+
        while((prev !== null) && (prev.nodeType != ELEMENT_NODE)) {
                prev = prev.previousSibling;
-       }       
-               
+       }
+
        return (prev !== null) && prev.hasAttribute('x-verse');
 }
 
-HTMLSerializer.prototype.serialize = function(rootElement, stripOuter) 
+HTMLSerializer.prototype.serialize = function(rootElement, stripOuter)
 {
        var self = this;
        self._prepare();
-       
+
        if(!stripOuter)
                self._pushElement(rootElement);
-       else    
+       else
                self._pushChildren(rootElement);
-       
+
        while(self.stack.length > 0) {
                var token = self.stack.pop();
-                                               
+
                if(token.type === ELEM_END) {
-                       self.result += "</" + token.tagName + ">";                                      
-                       for(var padding = getPadding(token.tagName); padding > 0; padding--) {                  
-                               self.result += "\n";                    
+                       self.result += "</" + token.tagName + ">";
+                       for(var padding = getPadding(token.tagName); padding > 0; padding--) {
+                               self.result += "\n";
                        }
                        continue;
                };
-               
+
                if(token.type === NS_END) {
                        self._unassignNamespace(token.namespace);
                        continue;
-               } 
-               
-               
+               }
+
+
                switch(token.node.nodeType) {
                        case ELEMENT_NODE:
                                if(token.node.hasAttribute('x-pass-thru')) {
                                        self._pushChildren(token.node);
                                        break;
                                }
-                               
+
                                if(!token.node.hasAttribute('x-node'))
                                        break;
-                                       
+
                                var xnode = token.node.getAttribute('x-node');
-                               
+
                                if(xnode === 'wers') {
                                        /* push children */
                                        if(self._verseBefore(token.node))
                                                self.result += '/\n';
                                        self._pushChildren(token.node);
-                                       break;                                  
-                               };                                      
-                               
+                                       break;
+                               };
+
                                if(xnode === 'out-of-flow-text') {
                                        self._pushChildren(token.node);
-                                       break;                                                                          
+                                       break;
                                }
-                               
+
                                if(token.node.hasAttribute('x-verse') && self._verseBefore(token.node)) {
-                                       self.result += '/\n';                                   
+                                       self.result += '/\n';
                                };
-                                       
+
                                self._serializeElement(token.node);
                                break;
                        case TEXT_NODE:
@@ -252,7 +252,7 @@ HTMLSerializer.prototype.serialize = function(rootElement, stripOuter)
                                break;
                };
        };
-       
+
        return this.result;
 }
 
@@ -262,84 +262,84 @@ HTMLSerializer.prototype.serialize = function(rootElement, stripOuter)
 HTMLSerializer.prototype._unassignNamespace = function(nsData) {
        this.nsMap[nsData.uri] = undefined;
 };
-       
+
 HTMLSerializer.prototype._assignNamespace = function(uri) {
        if(uri === null) {
                // default namespace
                return ({"prefix": "", "uri": "", "fresh": false});
        }
-       
+
        if(this.nsMap[uri] === undefined) {
-               // this prefix hasn't been defined yet in current context       
+               // this prefix hasn't been defined yet in current context
                var prefix = NAMESPACES[uri];
-               
+
                if (prefix === undefined) { // not predefined
                        prefix = "ns" + this.nsCounter;
                        this.nsCounter += 1;
                }
-               
-               this.nsMap[uri] = prefix;               
+
+               this.nsMap[uri] = prefix;
                return ({
                        "prefix": prefix,
                        "uri": uri,
                        "fresh": true
-               });                     
-       }       
-               
-       return ({"prefix": this.nsMap[uri], "uri": uri, "fresh": false});               
+               });
+       }
+
+       return ({"prefix": this.nsMap[uri], "uri": uri, "fresh": false});
 };
 
 HTMLSerializer.prototype._join = function(prefix, name) {
-       if(!!prefix) 
+       if(!!prefix)
                return prefix + ":" + name;
-       return name;    
+       return name;
 };
 
 HTMLSerializer.prototype._rjoin = function(prefix, name) {
-       if(!!name) 
+       if(!!name)
                return prefix + ":" + name;
-       return prefix;  
+       return prefix;
 };
-                                       
+
 HTMLSerializer.prototype._serializeElement = function(node) {
        var self = this;
-               
+
        var ns = node.getAttribute('x-ns');
        var nsPrefix = null;
        var newNamespaces = [];
-       
+
        var nsData = self._assignNamespace(node.getAttribute('x-ns'));
-       
+
        if(nsData.fresh) {
                newNamespaces.push(nsData);
                self.stack.push({
                        "type": NS_END,
                        "namespace": nsData
                });
-       }                                       
-       
+       }
+
        var tagName = self._join(nsData.prefix, node.getAttribute('x-node'));
-                               
+
        /* retrieve attributes */
        var attributeIDs = [];
        for (var i = 0; i < node.attributes.length; i++) {
                var attr = node.attributes.item(i);
-               
+
                // check if name starts with "x-attr-name"
                var m = attr.name.match(XATTR_RE);
-               if (m !== null) 
-                       attributeIDs.push(m[1]);                                
+               if (m !== null)
+                       attributeIDs.push(m[1]);
        };
-                               
+
        /* print out */
        if (getPadding(tagName))
                self.result += '\n';
-               
-       self.result += '<' + tagName;   
-                                       
+
+       self.result += '<' + tagName;
+
        $.each(attributeIDs, function() {
                var nsData = self._assignNamespace(node.getAttribute('x-attr-ns-'+this));
-       
+
                if(nsData.fresh) {
                        newNamespaces.push(nsData);
                        self.stack.push({
@@ -347,17 +347,17 @@ HTMLSerializer.prototype._serializeElement = function(node) {
                                "namespace": nsData
                        });
                };
-                                                                                                                       
+
                self.result += ' ' + self._join(nsData.prefix, node.getAttribute('x-attr-name-'+this));
                self.result += '="'+node.getAttribute('x-attr-value-'+this) +'"';
        });
-       
+
        /* print new namespace declarations */
        $.each(newNamespaces, function() {
                self.result += " " + self._rjoin("xmlns", this.prefix);
-               self.result += '="' + this.uri + '"';           
-       });                                     
-       
+               self.result += '="' + this.uri + '"';
+       });
+
        if (node.childNodes.length > 0) {
                self.result += ">";
                self._pushTagEnd(tagName);
@@ -368,11 +368,11 @@ HTMLSerializer.prototype._serializeElement = function(node) {
        };
 };
 
-function html2text(params) {   
+function html2text(params) {
        try {
                var s = new HTMLSerializer();
                params.success( s.serialize(params.element, params.stripOuter) );
        } catch(e) {
                params.error("Nie udało się zserializować tekstu:" + e)
-       }       
+       }
 }
\ No newline at end of file
index 0618a5e..72d1875 100644 (file)
@@ -8,37 +8,37 @@
                        body {
                                background-color: #84BF2A;
                        }
-                       
+
                        #main {
                                position: absolute;
                                top: 20%;
                                left: 20%;
-                               right: 20%;                     
+                               right: 20%;
                                border-width: 3px;
                                border-color: black;
                                border-style: ridge;
                                padding: 1em;
-                               background: white;      
+                               background: white;
                        }
-                       
+
                        #logo {
                                vertical-align: middle;
                        }
-                       
-                       p {                             
+
+                       p {
                                text-indent: 1em;
-                               text-align: justify;     
+                               text-align: justify;
                        }
-                                       
+
                        #main a {
                                text-decoration:none;
                                color: #325f70;
                        }
-                       
+
                        #main a:hover {
                                color: #f9c325;
                        }
-                        
+
                </style>
     </head>
     <body>
                <pre style="margin-left: 2em;">{{request.build_absolute_uri}}</pre>
                        <p>nie instnieje.</p>
                        <ul>
-                               <li>Sprawdź, czy adres nie zawiera literówek, np: 
+                               <li>Sprawdź, czy adres nie zawiera literówek, np:
                                <em>bog_mnie_oposcil</em>, zamiast <em>bog_mnie_opuscil</em>.
                                </li>
                                <li>
-                                       Upewnij się, że dokument do którego chcesz się dostać jest na 
-                                       <a href="http://stigma.nowoczesnapolska.org.pl/platforma">liście utworów</a>. 
+                                       Upewnij się, że dokument do którego chcesz się dostać jest na
+                                       <a href="http://stigma.nowoczesnapolska.org.pl/platforma">liście utworów</a>.
                                </li>
                                </ul>
-                       <p>Jeśli nadal nie jesteś w stanie odszukać dokumentu, skontaktuj się 
+                       <p>Jeśli nadal nie jesteś w stanie odszukać dokumentu, skontaktuj się
                                z <a href="mailto:platfroma@stigma.nowoczesnapolska.org.pl">administratorem</a>.</p>
-                       
-                       
+
+
                </div>
                </div>
     </body>
index ee72720..1774b5a 100644 (file)
@@ -8,33 +8,33 @@
                        body {
                                background-color: #84BF2A;
                        }
-                       
+
                        #main {
                                position: absolute;
                                top: 20%;
                                left: 20%;
-                               right: 20%;                     
+                               right: 20%;
                                border-width: 3px;
                                border-color: black;
                                border-style: ridge;
                                padding: 1em;
-                               background: white;      
+                               background: white;
                        }
-                       
+
                        #logo {
                                vertical-align: middle;
                        }
-                       
-                       p {                             
+
+                       p {
                                text-indent: 1em;
-                               text-align: justify;     
+                               text-align: justify;
                        }
-                                       
+
                        #main a {
                                text-decoration:none;
                                color: #325f70;
                        }
-                       
+
                        #main a:hover {
                                color: #f9c325;
                        }
@@ -44,7 +44,7 @@
        <div id="main">
        <h1><a href="http://stigma.nowoczesnapolska.org.pl/platforma">
                <img id="logo" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAABKCAYAAAD+IBtNAAAACXBIWXMAAAMTAAADEwE9ZoPHAAAgAElEQVR4nO2dd5iU1fX4P+e+78zs7MIqIIigsLusikFBWERRUazYNSr4jVKjASMqIGCJbdAkVLGiwZ+NYgnExGiMGkSwIrJUgwpIF1B63d0p7z2/P2Zm2Q4LKyXO53n22SnnnnvOfee8t7y3CDXAY5/mnOClmc+MZal15DOJ6We73ILPQ23XbqwJ/XuLKrJzWq1f+aweF7hg1wci6IHMP8X/HlITSobl5zRx1axU5QfQo0QkLfHVd9YyTZQPNvy09aMRV2/cURP5JVFFdn3oP9lVOd8xpiPQAaEegEvhsXIBa2oyvxS/PGokQABGzmq2wqj8Y0dG4J7MbdFTY0bbi6Nng14gSB0gqsoMa3nf8XuvDWqzfCXAqFm53WJil9/bdtlne5OPKhKb4p4jrr+bWr0SoQGqEYWZKuZjUXuuiJzsnl9YL1WDpNhf3JpSpPCxwrmhFgsjwFeJvydDismccUJb6/cuRuUix2GIRk3/0MtZTUO9VhSB9nOsWQtUGSDbPwycEDBOj8hU29U40sSqXYSVN4xrP3AKwtPlSgoAIlMDX6PyWSo4UtQENRcgnpmuju06dEGTOve1XLUl+XlIsLA4GTB/HDH7hA4G+0ntk92LgbctLBToUJne8BROEkkbKyIdsLpZRF61nnnJf/GueeVsmEhmTOVXGMbXlF8pftmYmlJkC51pghh/x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c47QJPdT3WTJMLzFyh2Ocs30uWVL3yCMefrjvOxkZmQ8Yca4NuMy+//7f/US6aXtMQ98NDz5465JgMJglojdizB2uoxeFunSJUDtwtxjTR9MCs8lMv14cc5GeVG/aSSfVf0Vc9zT8vnseeuj2mcZwpmOcs0MP3f7HzNoN6pDmL7UDhmMCA43IICNcbkRuzAjWGguQWbv+78Thclz3o8pkStpQUr5Sm4GHH7ptsLhyls8XfBsg1Lfvzocf6nsWPt/puE6Hhx/+/QeVlcXe+FPSjsrKZW/t4KQGvcVxztO0wJTdGVSss8L0FeRTVdn4fentjUjXjLSMmRwl9xpxrsWRpwH2xvcUKVKkSJEiRYoUv0j+P1GPgO+VXwPOAAAAAElFTkSuQmCC">
-                       </a>        
+                       </a>
                Błąd po stronie serwera.</h1>
                <p>Niestety nasz serwer WWW nie był w stanie dostarczyć Ci strony o którą prosiłeś.</p>
                        <p><b>Serdecznie przepraszamy.</b></p>
index 9d1e4fa..7f85276 100644 (file)
@@ -8,33 +8,33 @@
                        body {
                                background-color: #84BF2A;
                        }
-                       
+
                        #main {
                                position: absolute;
                                top: 20%;
                                left: 20%;
-                               right: 20%;                     
+                               right: 20%;
                                border-width: 3px;
                                border-color: black;
                                border-style: ridge;
                                padding: 1em;
-                               background: white;      
+                               background: white;
                        }
-                       
+
                        #logo {
                                vertical-align: middle;
                        }
-                       
-                       p {                             
+
+                       p {
                                text-indent: 1em;
-                               text-align: justify;     
+                               text-align: justify;
                        }
-                                       
+
                        #main a {
                                text-decoration:none;
                                color: #325f70;
                        }
-                       
+
                        #main a:hover {
                                color: #f9c325;
                        }
@@ -44,9 +44,9 @@
        <div id="main">
        <h1><a href="http://stigma.nowoczesnapolska.org.pl/platforma">
                <img id="logo" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAABKCAYAAAD+IBtNAAAACXBIWXMAAAMTAAADEwE9ZoPHAAAgAElEQVR4nO2dd5iU1fX4P+e+78zs7MIqIIigsLusikFBWERRUazYNSr4jV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/ZKpjMxBff4/2MsY9R9DicxnLlUU1/UlSrlyqa4eYR/r06VNq360KdJZLr6oVDPtXXDbq2Pnxr/UiRD4QkR2IXg2gPt87++r7oUbpJtb28JBwpGA9sFjRBla9XkOGjLlZVW8QYYMKTig05umRI8fv3vTN1TsE3lbVDt98u/FpVOIrDWO0ROP7a5nEir+KsI6TvCgG5QJB5gENgYqbRLtT+sF2FWR9RjDzXaSiZzplZEpSUr4Km7XMQIaIJs6BN35rvZDC45AYpSlXFnvhT4V2lymXvbcjMXVIK1zPUlJnRemHTJ7sK5tPpWWTeeQ8EVEFPyJfoCxUJSAi60J/6PNd9a7loUvpAKnlDpH4es54h1ZYrMq1AKrUV6vDFb29oGDH+cUXQY3f5wv0FpHVYBs6jvO8wGY8HYtyk4gssc2P+np3XppJor2sSi2J2dMTuacbo4NAcxTtiugjIoSTa9qLSW52Zhmv0AQjwxNNvoYJe5pUIVPShmL5KmyG4iaOZgLoUTJVhBmq9m3QjoLpBRRUVBZ75U9Juyspl2rYkbyeR5XQX6HOitKHunSJlM2nsrIJ3dl1O2h8x0yRBYjGb4Ia/7+Xvh/ylAqQ0KA+GzMzGzTHmKsc47QJPdT3WTJMLzFyh2Ocs30uWVL3yCMefrjvOxkZmQ8Yca4NuMy+//7f/US6aXtMQ98NDz5465JgMJglojdizB2uoxeFunSJUDtwtxjTR9MCs8lMv14cc5GeVG/aSSfVf0Vc9zT8vnseeuj2mcZwpmOcs0MP3f7HzNoN6pDmL7UDhmMCA43IICNcbkRuzAjWGguQWbv+78Thclz3o8pkStpQUr5Sm4GHH7ptsLhyls8XfBsg1Lfvzocf6nsWPt/puE6Hhx/+/QeVlcXe+FPSjsrKZW/t4KQGvcVxztO0wJTdGVSss8L0FeRTVdn4fentjUjXjLSMmRwl9xpxrsWRpwH2xvcUKVKkSJEiRYoUv0j+P1GPgO+VXwPOAAAAAElFTkSuQmCC">
-                       </a>        
+                       </a>
                Serwis tymczasowo niedostępny</h1>
-               <p>Platfroma redakcyjna serwisu <a href="http://wolnelektury.pl/">wolnelektury.pl</a> jest 
+               <p>Platfroma redakcyjna serwisu <a href="http://wolnelektury.pl/">wolnelektury.pl</a> jest
                tymczasowo niedostępna z powodu prac administracyjnych.
                        </p>
                        <p>Prosimy o wyrozumiałość i ponowne odwiedziny.</p>
index ab1ece2..45de219 100644 (file)
@@ -15,7 +15,7 @@
 {% if app_list %}
 
     {% include "filebrowser/append.html" %}
-    
+
     {% for app in app_list %}
         <div class="module">
         <table summary="{% blocktrans with app.name as name %}Models available in the {{ name }} application.{% endblocktrans %}">
index ee20ef2..f051213 100644 (file)
@@ -1,7 +1,7 @@
 {% load i18n %}
 
 {% if user.is_authenticated %}
-<span class="user_name">{{ user.username }}</span> | 
+<span class="user_name">{{ user.username }}</span> |
 <a href='{% url logout %}'>{% trans "Log Out" %}</a>
 {% else %}
 {% url login as login_url %}
index d875a6e..2e50e4b 100644 (file)
@@ -14,7 +14,7 @@ urlpatterns = patterns('',
     # Admin panel
     (r'^admin/filebrowser/', include('filebrowser.urls')),
     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
-    url(r'^admin/(.*)', admin.site.root),
+    (r'^admin/', include(admin.site.urls)),
 
     # Static files (should be served by Apache)
     url(r'^%s(?P<path>.+)$' % settings.MEDIA_URL[1:], 'django.views.static.serve',