Apache2-Translation

 view release on metacpan or  search on metacpan

lib/Apache2/Translation/Admin/my.js  view on Meta::CPAN

      ta.name="action_"+oldblock+"_"+block+"_"+ord+"_"+order+"_"+id;
      if( tc ) tc.name="note_"+block+"_"+order;
      hi.name="ysize_"+block+"_"+order;
      hi.value=Element.getHeight(tds[i])-(Prototype.Browser.IE ? 4 : 0);
    }
  }
}

function update_header( counter, key, uri ) {
  if( uri==":PRE:" || uri==":LOOKUPFILE:" ) {
    Element.update( 'header'+counter, key.escapeHTML() );
  } else {
    Element.update( 'header'+counter,
		    key.escapeHTML()+" <img class=\"pfeil\" src=\"pfeil.gif\"> "+ uri.escapeHTML() );
  }
}

function xupdate( counter, o, focus ) {
  if(o) o.blur();
  focus=focus2index(focus);
  xreorder( counter );
  var params=$('form'+counter).getElements().inject
    ({}, function(hash, element) {
       element = $(element);

lib/Apache2/Translation/Admin/my.js  view on Meta::CPAN

    newnode.innerHTML=
      ( '<div class="fetch">'+
	'<form new_element="1" id="form'+next_counter+'"'+
	'	  onsubmit="return false;"'+
	'	  ADM_COUNTER="'+next_counter+'"'+
	'	  ADM_NBLOCKS="1">'+
	'	<table class="tdc">'+
	'		<tr>'+
	'			<td class="tdcol1">New Key:</td>'+
	'			<td class="tdcol2">'+
	'				<input type="text" name="newkey" id="key'+next_counter+'" value="'+key.escapeHTML()+'">'+
	'			</td>'+
	'		</tr>'+
	(uri==":PRE:" || uri==":LOOKUPFILE:"
	 ? ('		<input type="hidden" name="newuri" id="uri'+next_counter+'" value="'+uri.escapeHTML()+'">')
	 : ('		<tr>'+
	    '			<td class="tdcol1">New Uri:</td>'+
	    '			<td class="tdcol2">'+
	    '				<input type="text" name="newuri" id="uri'+next_counter+'" value="'+uri.escapeHTML()+'">'+
	    '			</td>'+
	    '		</tr>'))+
	'		<tr><th colspan="2"><br>Action</th></tr>'+
	'		<tr class="tdc">'+
	'			<td ADM_BLOCK="0" ADM_ORDER="" ADM_ID=""'+
	'				colspan="2" class="tdc1">'+
	'			    <input type="hidden" name="ysize">'+
	'		            <table class="inner_tdc">'+
	'		                <tr>'+
	'                                   <td class="fetch_ta">'+

lib/Apache2/Translation/Admin/prototype.js  view on Meta::CPAN

        break;
      } catch (e) { }
    }

    return returnValue;
  }
};

RegExp.prototype.match = RegExp.prototype.test;

RegExp.escape = function(str) {
  return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
};

/*--------------------------------------------------------------------------*/

var PeriodicalExecuter = Class.create({
  initialize: function(callback, frequency) {
    this.callback = callback;
    this.frequency = frequency;
    this.currentlyExecuting = false;

lib/Apache2/Translation/Admin/prototype.js  view on Meta::CPAN

    var matchOne = new RegExp(Prototype.ScriptFragment, 'im');
    return (this.match(matchAll) || []).map(function(scriptTag) {
      return (scriptTag.match(matchOne) || ['', ''])[1];
    });
  },

  evalScripts: function() {
    return this.extractScripts().map(function(script) { return eval(script) });
  },

  escapeHTML: function() {
    var self = arguments.callee;
    self.text.data = this;
    return self.div.innerHTML;
  },

  unescapeHTML: function() {
    var div = new Element('div');
    div.innerHTML = this.stripTags();
    return div.childNodes[0] ? (div.childNodes.length > 1 ?
      $A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) :
      div.childNodes[0].nodeValue) : '';
  },

  toQueryParams: function(separator) {
    var match = this.strip().match(/([^?#]*)(#.*)?$/);
    if (!match) return { };

lib/Apache2/Translation/Admin/prototype.js  view on Meta::CPAN


  underscore: function() {
    return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase();
  },

  dasherize: function() {
    return this.gsub(/_/,'-');
  },

  inspect: function(useDoubleQuotes) {
    var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) {
      var character = String.specialChar[match[0]];
      return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16);
    });
    if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"';
    return "'" + escapedString.replace(/'/g, '\\\'') + "'";
  },

  toJSON: function() {
    return this.inspect(true);
  },

  unfilterJSON: function(filter) {
    return this.sub(filter || Prototype.JSONFilter, '#{1}');
  },

lib/Apache2/Translation/Admin/prototype.js  view on Meta::CPAN

  blank: function() {
    return /^\s*$/.test(this);
  },

  interpolate: function(object, pattern) {
    return new Template(this, pattern).evaluate(object);
  }
});

if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, {
  escapeHTML: function() {
    return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
  },
  unescapeHTML: function() {
    return this.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>');
  }
});

String.prototype.gsub.prepareReplacement = function(replacement) {
  if (Object.isFunction(replacement)) return replacement;
  var template = new Template(replacement);
  return function(match) { return template.evaluate(match) };
};

String.prototype.parseQuery = String.prototype.toQueryParams;

Object.extend(String.prototype.escapeHTML, {
  div:  document.createElement('div'),
  text: document.createTextNode('')
});

with (String.prototype.escapeHTML) div.appendChild(text);

var Template = Class.create({
  initialize: function(template, pattern) {
    this.template = template.toString();
    this.pattern = pattern || Template.Pattern;
  },

  evaluate: function(object) {
    if (Object.isFunction(object.toTemplateReplacements))
      object = object.toTemplateReplacements();

lib/Apache2/Translation/Admin/prototype.js  view on Meta::CPAN

    return this.transport.getResponseHeader(name);
  },

  getAllResponseHeaders: function() {
    return this.transport.getAllResponseHeaders();
  },

  _getHeaderJSON: function() {
    var json = this.getHeader('X-JSON');
    if (!json) return null;
    json = decodeURIComponent(escape(json));
    try {
      return json.evalJSON(this.request.options.sanitizeJSON);
    } catch (e) {
      this.request.dispatchException(e);
    }
  },

  _getResponseJSON: function() {
    var options = this.request.options;
    if (!options.evalJSON || (options.evalJSON != 'force' &&



( run in 0.369 second using v1.01-cache-2.11-cpan-c21f80fb71c )