new static files.
Signed-off-by: rscnt <rascnt@gmail.com>
This commit is contained in:
parent
83e792bcaa
commit
fe4f6c97d5
778 changed files with 71557 additions and 0 deletions
1263
static/filer/js/fileuploader.js
Normal file
1263
static/filer/js/fileuploader.js
Normal file
File diff suppressed because it is too large
Load diff
86
static/filer/js/focal_point.js
Normal file
86
static/filer/js/focal_point.js
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
(function($) {
|
||||
$(function(){
|
||||
var PAPER_WIDTH, PAPER_HEIGTH;
|
||||
var paper, ratio;
|
||||
var isDrag = false;
|
||||
var dragger = function (e) {
|
||||
this.dx = e.clientX;
|
||||
this.dy = e.clientY;
|
||||
isDrag = this;
|
||||
this.animate({"fill-opacity": .3, "fill": "#fffccc"}, 500);
|
||||
};
|
||||
|
||||
document.onmousemove = function (e) {
|
||||
e = e || window.event;
|
||||
if (isDrag) {
|
||||
isDrag.translate(e.clientX - isDrag.dx, e.clientY - isDrag.dy);
|
||||
paper.safari();
|
||||
isDrag.dx = e.clientX;
|
||||
isDrag.dy = e.clientY;
|
||||
}
|
||||
};
|
||||
|
||||
document.onmouseup = function (e) {
|
||||
if (isDrag) {
|
||||
isDrag.animate({"fill-opacity": .2, "fill": "#fff"}, 500);
|
||||
if (isDrag.type == "circle") {
|
||||
updatePosition(isDrag.attrs.cx, isDrag.attrs.cy);
|
||||
}
|
||||
}
|
||||
isDrag = false;
|
||||
};
|
||||
|
||||
var focalPoint;
|
||||
|
||||
function add(x, y) {
|
||||
if (isNaN(x)) {
|
||||
x = PAPER_WIDTH / 2;
|
||||
y = PAPER_HEIGTH / 2;
|
||||
}
|
||||
var el = paper.circle(x, y, 15);
|
||||
el.attr("fill", "#fff");
|
||||
el.attr("fill-opacity", .2);
|
||||
el.attr("stroke", "#c00");
|
||||
el.attr('stroke-width', 2);
|
||||
|
||||
|
||||
el.mousedown(dragger);
|
||||
el.node.style.cursor = "move";
|
||||
focalPoint = el;
|
||||
}
|
||||
|
||||
function remove(id){
|
||||
focalPoint.remove();
|
||||
focalPoint = null;
|
||||
}
|
||||
|
||||
function updatePosition(x, y) {
|
||||
$("#id_subject_location").val(x === undefined ? '' : parseInt(parseInt(x)*ratio) + ',' + parseInt(parseInt(y)*ratio) );
|
||||
}
|
||||
|
||||
|
||||
$('#image_container img').load(function(){
|
||||
PAPER_WIDTH = $('#image_container img').width();
|
||||
PAPER_HEIGTH = $('#image_container img').height();
|
||||
$('#image_container').height(PAPER_HEIGTH + 'px');
|
||||
|
||||
// interface
|
||||
ratio = parseFloat($('#image_container img').attr('rel'));
|
||||
paper = Raphael(document.getElementById("paper"), PAPER_WIDTH, PAPER_HEIGTH);
|
||||
// read location from form
|
||||
var location = $("#id_subject_location").val();
|
||||
var x, y;
|
||||
if (location){
|
||||
x = parseInt(parseInt(location.split(',')[0])/ratio);
|
||||
y = parseInt(parseInt(location.split(',')[1])/ratio);
|
||||
}
|
||||
add(x, y);
|
||||
});
|
||||
});
|
||||
})(django.jQuery);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
97
static/filer/js/jquery.cookie.js
Normal file
97
static/filer/js/jquery.cookie.js
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
/**
|
||||
* Cookie plugin
|
||||
*
|
||||
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a cookie with the given name and value and other optional parameters.
|
||||
*
|
||||
* @example $.cookie('the_cookie', 'the_value');
|
||||
* @desc Set the value of a cookie.
|
||||
* @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
|
||||
* @desc Create a cookie with all available options.
|
||||
* @example $.cookie('the_cookie', 'the_value');
|
||||
* @desc Create a session cookie.
|
||||
* @example $.cookie('the_cookie', null);
|
||||
* @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
|
||||
* used when the cookie was set.
|
||||
*
|
||||
* @param String name The name of the cookie.
|
||||
* @param String value The value of the cookie.
|
||||
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
|
||||
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
|
||||
* If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
|
||||
* If set to null or omitted, the cookie will be a session cookie and will not be retained
|
||||
* when the the browser exits.
|
||||
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
|
||||
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
|
||||
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
|
||||
* require a secure protocol (like HTTPS).
|
||||
* @type undefined
|
||||
*
|
||||
* @name $.cookie
|
||||
* @cat Plugins/Cookie
|
||||
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
||||
*/
|
||||
|
||||
/**
|
||||
* Get the value of a cookie with the given name.
|
||||
*
|
||||
* @example $.cookie('the_cookie');
|
||||
* @desc Get the value of a cookie.
|
||||
*
|
||||
* @param String name The name of the cookie.
|
||||
* @return The value of the cookie.
|
||||
* @type String
|
||||
*
|
||||
* @name $.cookie
|
||||
* @cat Plugins/Cookie
|
||||
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
||||
*/
|
||||
jQuery.cookie = function(name, value, options) {
|
||||
if (typeof value != 'undefined') { // name and value given, set cookie
|
||||
options = options || {};
|
||||
if (value === null) {
|
||||
value = '';
|
||||
options = $.extend({}, options); // clone object since it's unexpected behavior if the expired property were changed
|
||||
options.expires = -1;
|
||||
}
|
||||
var expires = '';
|
||||
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
|
||||
var date;
|
||||
if (typeof options.expires == 'number') {
|
||||
date = new Date();
|
||||
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
|
||||
} else {
|
||||
date = options.expires;
|
||||
}
|
||||
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
|
||||
}
|
||||
// NOTE Needed to parenthesize options.path and options.domain
|
||||
// in the following expressions, otherwise they evaluate to undefined
|
||||
// in the packed version for some reason...
|
||||
var path = options.path ? '; path=' + (options.path) : '';
|
||||
var domain = options.domain ? '; domain=' + (options.domain) : '';
|
||||
var secure = options.secure ? '; secure' : '';
|
||||
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
|
||||
} else { // only name given, get cookie
|
||||
var cookieValue = null;
|
||||
if (document.cookie && document.cookie != '') {
|
||||
var cookies = document.cookie.split(';');
|
||||
for (var i = 0; i < cookies.length; i++) {
|
||||
var cookie = jQuery.trim(cookies[i]);
|
||||
// Does this cookie string begin with the name we want?
|
||||
if (cookie.substring(0, name.length + 1) == (name + '=')) {
|
||||
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return cookieValue;
|
||||
}
|
||||
};
|
||||
25
static/filer/js/popup_handling.js
Normal file
25
static/filer/js/popup_handling.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
(function($) {
|
||||
dismissPopupAndReload = function(win) {
|
||||
document.location.reload();
|
||||
win.close();
|
||||
};
|
||||
dismissRelatedImageLookupPopup = function(win, chosenId, chosenThumbnailUrl, chosenDescriptionTxt) {
|
||||
var name = windowname_to_id(win.name);
|
||||
var img_name = name + '_thumbnail_img';
|
||||
var txt_name = name + '_description_txt';
|
||||
var clear_name = name + '_clear';
|
||||
var elem = document.getElementById(name);
|
||||
document.getElementById(name).value = chosenId;
|
||||
document.getElementById(img_name).src = chosenThumbnailUrl;
|
||||
document.getElementById(txt_name).innerHTML = chosenDescriptionTxt;
|
||||
document.getElementById(clear_name).style.display = 'inline';
|
||||
win.close();
|
||||
};
|
||||
dismissRelatedFolderLookupPopup = function(win, chosenId, chosenName) {
|
||||
var id = windowname_to_id(win.name);
|
||||
var id_name = id + '_description_txt';
|
||||
document.getElementById(id).value = chosenId;
|
||||
document.getElementById(id_name).innerHTML = chosenName;
|
||||
win.close();
|
||||
};
|
||||
})(django.jQuery);
|
||||
7
static/filer/js/raphael.js
Normal file
7
static/filer/js/raphael.js
Normal file
File diff suppressed because one or more lines are too long
3
static/filer/js/retina.js
Normal file
3
static/filer/js/retina.js
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
// retina.js, a high-resolution image swapper (http://retinajs.com), v0.0.2
|
||||
|
||||
(function(){function t(e){this.path=e;var t=this.path.split("."),n=t.slice(0,t.length-1).join("."),r=t[t.length-1];this.at_2x_path=n+"@2x."+r}function n(e){this.el=e,this.path=new t(this.el.getAttribute("src"));var n=this;this.path.check_2x_variant(function(e){e&&n.swap()})}var e=typeof exports=="undefined"?window:exports;e.RetinaImagePath=t,t.confirmed_paths=[],t.prototype.is_external=function(){return!!this.path.match(/^https?\:/i)&&!this.path.match("//"+document.domain)},t.prototype.check_2x_variant=function(e){var n,r=this;if(this.is_external())return e(!1);if(this.at_2x_path in t.confirmed_paths)return e(!0);n=new XMLHttpRequest,n.open("HEAD",this.at_2x_path),n.onreadystatechange=function(){return n.readyState!=4?e(!1):n.status>=200&&n.status<=399?(t.confirmed_paths.push(r.at_2x_path),e(!0)):e(!1)},n.send()},e.RetinaImage=n,n.prototype.swap=function(e){function n(){t.el.complete?(t.el.setAttribute("width",t.el.offsetWidth),t.el.setAttribute("height",t.el.offsetHeight),t.el.setAttribute("src",e)):setTimeout(n,5)}typeof e=="undefined"&&(e=this.path.at_2x_path);var t=this;n()},e.devicePixelRatio>1&&(window.onload=function(){var e=document.getElementsByTagName("img"),t=[],r,i;for(r=0;r<e.length;r++)i=e[r],t.push(new n(i))})})();
|
||||
20
static/filer/js/widget.js
Normal file
20
static/filer/js/widget.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
(function($) {
|
||||
var filer_clear = function(e){
|
||||
var clearer = $(this),
|
||||
hidden_input = clearer.closest('.filerFile').find('input.vForeignKeyRawIdAdminField'),
|
||||
base_id = '#'+hidden_input.attr('id'),
|
||||
thumbnail = $(base_id+'_thumbnail_img'),
|
||||
description = $(base_id+'_description_txt'),
|
||||
static_prefix = clearer.attr('src').replace('admin/img/icon_deletelink.gif', 'filer/');
|
||||
clearer.hide();
|
||||
hidden_input.removeAttr("value");
|
||||
thumbnail.attr("src", static_prefix+"icons/nofile_48x48.png");
|
||||
description.html("");
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
$('.filerFile .vForeignKeyRawIdAdminField').attr('type', 'hidden');
|
||||
//if this file is included multiple time, we ensure that filer_clear is attached only once.
|
||||
$(document).off('click.filer', '.filerFile .filerClearer', filer_clear).on('click.filer', '.filerFile .filerClearer', filer_clear);
|
||||
});
|
||||
})(django.jQuery);
|
||||
Loading…
Add table
Add a link
Reference in a new issue