Updates the url of the image or link node by calling the
callback promise

@method updateUrl

@param  {Function} cb
@param  {Object}   urlNode
@param  {Object}   options

@return {Promise}
321425
function updateUrl (cb, urlNode, options) {
  return cb(urlNode.url, options)
    .then((response) => {
      if (response) {
        Object.assign(urlNode, response)
      }
    })
    .catch(() => {
    })
}
832162
function resolvedUrlFor (shortcode, size, cb) {
  if (typeof size === 'function') {
    cb = size
    size = 'l'
  }
  cb = cb || function () {}

  var apiUrl = apiUrlFor(shortcode, size)

  var opts = url.parse(apiUrl)
  // http requests use the global Agent (connection pool) and defaults to `Connection: keep-alive`
  // This causes the test suite to hang, so we explicitly set it to close.
  // Alternatively, set `opts.agent: false` to opt out of connection pool and default to `Connection: close`
  // see: http://nodejs.org/api/http.html#http_http_request_options_callback
  opts.headers = {
    Connection:'close'
  }

  http.get(opts, function (res) {
    var url = res && res.headers && res.headers.location
    if (!url) return cb(new Error('Couldn\'t get url; no `location` header on response'), res)
    cb(null, url)

  }).on('error', cb)
}
963280
function updateImageSizeCSS(editor, model) {
	const pos = editor.getCursorBufferPosition();
	const property = getImageCSSNode(editor, model, pos);
	const urlToken = findUrlToken(property, pos);
	const src = urlToken && getImageSrcCSS(urlToken);

	if (!src) {
		return Promise.reject(new Error('No valid image source'));
	}

	locateFile(editor, src)
	.then(getImageSize)
	.then(size => {
		// since this action is asynchronous, we have to ensure that editor wasn’t
		// changed and user didn’t moved caret outside <img> node
		if (getImageCSSNode(editor, model, pos) === property) {
			updateCSSNode(editor, property, size.width, size.height);
		}
	})
	.catch(err => console.warn('Error while updating image size:', err));
}
1373557
function(model, attributes, opt) {

        opt || (opt = {});

        // update the link path
        this.updateConnection(opt);

        // update SVG attributes defined by 'attrs/'.
        this.updateDOMSubtreeAttributes(this.el, this.model.attr(), { selectors: this.selectors });

        this.updateDefaultConnectionPath();

        // update the label position etc.
        this.updateLabelPositions();
        this.updateToolsPosition();
        this.updateArrowheadMarkers();

        this.updateTools(opt);
        // Local perpendicular flag (as opposed to one defined on paper).
        // Could be enabled inside a connector/router. It's valid only
        // during the update execution.
        this.options.perpendicular = null;
        // Mark that postponed update has been already executed.
        this.updatePostponed = false;

        return this;
    }
616654
function getUrl (url) {
  var opt = {
    url: url
  , timeout: 10000 // 10 seconds
  }
  ;
  return new Promise(function(resolve, reject){
    request(opt, function(err, res, body){
      if (err) { return reject(err); }
      resolve(body)
    });
  });
}
335284
function requestUrl(url, callback) {
  var req = new XMLHttpRequest();
  req.addEventListener("load", function () {
    callback(req.responseText);
  });
  req.open("GET", url);
  req.send();
}
644756
def url(self, node):
        
        a_node = node.findParent('a')
        if not a_node:
            return None

        if self.link_callback is None:
            return a_node.get('href')
        else:
            return self.link_callback(a_node.get('href'))
1167859
function(cb){
      this.toCanvas(function(canvas){
        var dataUrl = canvas.toDataURL().replace(/^data:image\/(png|jpg);base64,/, "");
        var byteString = atob(escape(dataUrl));
        // write the bytes of the string to an ArrayBuffer
        var ab = new ArrayBuffer(byteString.length);
        var ia = new Uint8Array(ab);
        for (var i = 0; i < byteString.length; i++) {
          ia[i] = byteString.charCodeAt(i);
        }
        var dataView = new DataView(ab);
        var blob = new Blob([dataView], {type: "image/png"});
        cb(blob);
      });
    }
431743
function (url, onImageReady, applyAutocrop) {
            var _this = this;

            this.toggleLoadingImage(true);
            this.clear();
            this._applyAutocrop = (applyAutocrop !== false);

            this._image = new IMSoftcrop.Image(
                IMSoftcrop.Ratio.hashFnv32a(url),
                this
            );

            this._image.load(
                url,
                function () {
                    _this.setZoomToImage(false);
                    _this.centerImage(false);
                    _this.updateImageInfo(false);

                    if (_this._autocrop) {
                        _this.detectDetails();
                        _this.detectFaces();
                    }
                    else {
                        _this.toggleLoadingImage(false);
                    }

                    _this.applySoftcrops();
                    _this.redraw();

                    if (typeof onImageReady === 'function') {
                        onImageReady.call(_this, _this._image);
                    }
                }
            );
        }
689796
function UrlNode(data){
    this.append = function(next){
        this.next = next;
    };
    this.getData = function(){
        return this.data;
    };
    this.setData = function(data){
        this.data = data;
    }
    this.getNext = function(){
        return this.next;
    };
    this.setParams = function(params){
        var queryParameters = params.split("&");
        if(queryParameters != null){
            this.params = [];
            for(var counter = 0; counter < queryParameters.length; counter++) {
                var keyValuePair = queryParameters[counter].split("=");
                this.params[keyValuePair[0]] = keyValuePair[1];
            }
        } else{
            queryParameters = null;
        }
    };
    this.getParams = function(){
        return this.params;
    };

    //set var's for this object
    var queryParamSplit = data.split("?");
    this.params = null;
    this.data = null;
    this.next = null;
    if(queryParamSplit != null && queryParamSplit.length > 1){
        this.setData(queryParamSplit[0]);
        this.setParams(queryParamSplit[1]);
    } else{
        this.setData(data);
    }
}
145935
function(callback) {

      if (this.filters.length === 0) {
        this.setElement(this._originalImage);
        callback && callback();
        return;
      }

      var isLikelyNode = typeof Buffer !== 'undefined' && typeof window === 'undefined',
          imgEl = this._originalImage,
          canvasEl = fabric.document.createElement('canvas'),
          replacement = isLikelyNode ? new (require('canvas').Image) : fabric.document.createElement('img'),
          _this = this;

        if (!canvasEl.getContext && typeof G_vmlCanvasManager != 'undefined') {
          G_vmlCanvasManager.initElement(canvasEl);
        }

      canvasEl.width = imgEl.width;
      canvasEl.height = imgEl.height;

      canvasEl.getContext('2d').drawImage(imgEl, 0, 0, imgEl.width, imgEl.height);

      this.filters.forEach(function(filter) {
        filter && filter.applyTo(canvasEl);
      });

       /** @ignore */
      replacement.onload = function() {
        _this._element = replacement;
        callback && callback();
        replacement.onload = canvasEl = imgEl = null;
      };
      replacement.width = imgEl.width;
      replacement.height = imgEl.height;

      if (isLikelyNode) {
        var base64str = canvasEl.toDataURL('image/png').replace(/data:image\/png;base64,/, '');
        replacement.src = new Buffer(base64str, 'base64');
        _this._element = replacement;

        // onload doesn't fire in node, so we invoke callback manually
        callback && callback();
      }
      else {
        replacement.src = canvasEl.toDataURL('image/png');
      }

      return this;
    }
679043
function (opts, cb) {
            var self = this;
            cb = cb || function () {
                };
            opts = opts || {};
            var url = this._getlisturi(opts);
            this.client.get({
                uri: url,
                data:opts
            }, cb);
        }
135574
function setURLParameter(url, key, value) {
  if(typeof url !== 'string') {
    throw new Error('URLs must be a string');
  }

  if(urlUtils) {
    //node.js
    url = urlUtils.parse(url);

    url.search = ((url.search) ? url.search + '&' : '?') + key + '=' + value;

    url = urlUtils.format(url);
  }
  else {
    //browser
    url = url.split('?');

    url[1] = ((url[1]) ? url[1] + '&' : '') + key + '=' + value;

    url = url.join('?');
  }

  return url;
}
345706
function(link, cb){
            var id = Math.abs(crc32.str(md5(link)));
            
            var options = {
                host: urlArr.hostname,
                port: urlArr.port,
                path: "/delete/"+id,
                method: 'DELETE',
                headers: {
                    'Content-Type': 'application/x-www-form-urlencoded'
                }
            };
                                    
            var deleteRequest = protocol.request(options, function(res){
                var result = "";
                
                if(res.statusCode === 200){
                    res.on('error', function(error){
                        if(typeof cb === "function")
                            cb(error);
                    });

                    res.on('data', function(chunk){
                        result += chunk;
                    });

                    res.on('end', function(chunk){
                        if(typeof cb === "function"){
                            var resultObj = JSON.parse(result);
                            var err = (resultObj.status === "error") ? resultObj["msg"] : null
                            cb(err, resultObj);
                        }    
                    });
                }
                else{
                    if(typeof cb === "function")
                        cb("Request return HTTP "+res.statusCode);
                }
            });
            
            deleteRequest.end();
        }
916722
function (db, options, cb) {
	this.db = db;
	this.cb = cb;
	this.updateQueryMaker = options.update;
	this.insertQueryMaker = options.insert;
	this.maxUpdateAttemptsCount = options.maxUpdateAttemptsCount || 2;
	this.transform = options.transform;
	this.insertFirst = !!options.insertFirst;
	this.nonQuery = !!options.nonQuery;

	var self = this;
	this.updateAttemptsCount = 0;
	this.updateOrInsertBound = function () {
		self.updateOrInsert();
	};
}
580539
function(imageUrl, callback) {
        readers.getContentsFromUrl(imageUrl.toString(), function(err, data) {
            callback(err, err ? null : data);
        });

        return this;
    }
686820
function(url, win, attributes) {
        var o = {
            id:   Y.guid(),
            type: TYPE_CSS,
            rel:  STYLESHEET,
            href: url
        };
        if (attributes) {
            Y.mix(o, attributes);
        }
        return _node("link", o, win);
    }