Apache-UploadMeter

 view release on metacpan or  search on metacpan

lib/Apache/UploadMeter/Resources/CSS.pm  view on Meta::CPAN

    height: 1em;
    margin: 2px 0 2px 0;
    display: block;
    border: 1px blue solid;
}
.metercontent {
    text-align:center;
    display:inline;
}
.meterunderlay {
    background-color: blue;
    opacity: 0.5;
    filter: alpha(opacity=50);
    display:inline;
}
CSS-END
    $r->print($output);
    return Apache2::Const::OK;
}

1;

lib/Apache/UploadMeter/Resources/JavaScript.pm  view on Meta::CPAN

Object.extend(Object.extend(Effect.Highlight.prototype, Effect.Base.prototype), {
  initialize: function(element) {
    this.element = $(element);
    if(!this.element) throw(Effect._elementDoesNotExistError);
    var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || {});
    this.start(options);
  },
  setup: function() {
    // Prevent executing on elements not in the layout flow
    if(this.element.getStyle('display')=='none') { this.cancel(); return; }
    // Disable background image during the effect
    this.oldStyle = {};
    if (!this.options.keepBackgroundImage) {
      this.oldStyle.backgroundImage = this.element.getStyle('background-image');
      this.element.setStyle({backgroundImage: 'none'});
    }
    if(!this.options.endcolor)
      this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff');
    if(!this.options.restorecolor)
      this.options.restorecolor = this.element.getStyle('background-color');
    // init color calculations
    this._base  = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this));
    this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this));
  },
  update: function(position) {
    this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){
      return m+(Math.round(this._base[i]+(this._delta[i]*position)).toColorPart()); }.bind(this)) });
  },
  finish: function() {
    this.element.setStyle(Object.extend(this.oldStyle, {
      backgroundColor: this.options.restorecolor
    }));
  }
});

Effect.ScrollTo = Class.create();
Object.extend(Object.extend(Effect.ScrollTo.prototype, Effect.Base.prototype), {
  initialize: function(element) {
    this.element = $(element);
    this.start(arguments[1] || {});
  },

lib/Apache/UploadMeter/Resources/JavaScript.pm  view on Meta::CPAN

      this.tracks.map(function(track){
        var elements = [$(track.ids) || $$(track.ids)].flatten();
        return elements.map(function(e){ return new track.effect(e, Object.extend({ sync:true }, track.options)) });
      }).flatten(),
      this.options
    );
  }
});

Element.CSS_PROPERTIES = $w(
  'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' + 
  'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' +
  'borderRightColor borderRightStyle borderRightWidth borderSpacing ' +
  'borderTopColor borderTopStyle borderTopWidth bottom clip color ' +
  'fontSize fontWeight height left letterSpacing lineHeight ' +
  'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+
  'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' +
  'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' +
  'right textIndent top width wordSpacing zIndex');
  
Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;

lib/Apache/UploadMeter/Resources/JavaScript.pm  view on Meta::CPAN

        // Call onCreate hook
        try {
            (this.options.onCreate || Prototype.emptyFunction)();
            UploadMeter.Responders.dispatch('onCreate', this);
        } catch (e) {
            this.dispatchException(e);
        }
        var errorFunc = function (transport) {
            Element.setStyle(this.main, {'border-color': 'yellow'});
            Element.update(this.desc, "Unknown");
            Element.setStyle(this.ul, {'background-color': 'yellow'}).hide();
            Position.clone(this.main, this.ul);
            Element.show(this.ul);
        }.bind(this);
        // New meter
        var params = "format=json&meter_id=" + this.meter;
        new Ajax.Request(this.url, {
            parameters: params,
            onSuccess: function(transport) {
               // Handle response
               this.__onSuccess(transport);

lib/Apache/UploadMeter/Resources/XML.pm  view on Meta::CPAN

	<xsl:template match="/">
		<xsl:apply-templates/>
	</xsl:template>
	<!-- main rule for document element -->
	<xsl:template match="APACHE_UPLOADMETER">
		<html>
			<head>
				<title>Downloading <xsl:value-of select="@FILE"/>
				</title>
			</head>
			<body style="background-color: #D0D9DF; text-align: center; margin: 0px 0px 0px 0px;">
				<span style="text-align: center; font-face: Arial; font-size: 12pt;">
					<span style="text-align: center; font-size: 14pt; font-weight: bold;">Apache Upload Meter</span>
					<table width="100%" border="0" cellspacing="5" cellpadding="0">
						<tbody>
							<tr>
								<td width="30%" align="right">Filename:</td>
								<td width="70%" align="left">
									<xsl:value-of select="@FILE"/>
								</td>
							</tr>



( run in 1.220 second using v1.01-cache-2.11-cpan-f56aa216473 )