click from download control
174619
function onDownloadClick() {
		const a = document.head.appendChild($('a', { download: '', href: media.src }));

		a.click();

		document.head.removeChild(a);
	}
1357532
def click(self, x, y):
        '''
        
        '''
        self.shell('input', 'tap', str(x), str(y))
802246
function click(event) {
      event.preventDefault();

      Components.Run.make(Components.Direction.resolve(event.currentTarget.getAttribute('data-glide-dir')));
    }
142843
public function download_menu()
    {
        $this->include_script('zipdownload.js');
        $this->add_label('download');

        $rcmail  = rcmail::get_instance();
        $menu    = array();
        $ul_attr = array('role' => 'menu', 'aria-labelledby' => 'aria-label-zipdownloadmenu');
        if ($rcmail->config->get('skin') != 'classic') {
            $ul_attr['class'] = 'toolbarmenu';
        }

        foreach (array('eml', 'mbox', 'maildir') as $type) {
            $menu[] = html::tag('li', null, $rcmail->output->button(array(
                    'command'  => "download-$type",
                    'label'    => "zipdownload.download$type",
                    'classact' => 'active',
            )));
        }

        $rcmail->output->add_footer(html::div(array('id' => 'zipdownload-menu', 'class' => 'popupmenu', 'aria-hidden' => 'true'),
            html::tag('h2', array('class' => 'voice', 'id' => 'aria-label-zipdownloadmenu'), "Message Download Options Menu") .
            html::tag('ul', $ul_attr, implode('', $menu))));
    }
20522
def download_from_link(self, link, **kwargs):
        
        # old:new format
        old_arg_map = {'save_path': 'savepath'}  # , 'label': 'category'}

        # convert old option names to new option names
        options = kwargs.copy()
        for old_arg, new_arg in old_arg_map.items():
            if options.get(old_arg) and not options.get(new_arg):
                options[new_arg] = options[old_arg]

        if type(link) is list:
            options['urls'] = "\n".join(link)
        else:
            options['urls'] = link

        # workaround to send multipart/formdata request
        # http://stackoverflow.com/a/23131823/4726598
        dummy_file = {'_dummy': (None, '_dummy')}

        return self._post('command/download', data=options, files=dummy_file)
254952
function _cmdAbortDownload(downloadId) {
    if (!pendingDownloads[downloadId]) {
        // This may mean the download already completed
        return false;
    } else {
        _endDownload(downloadId, Errors.CANCELED);
        return true;
    }
}
1230769
def initiate_browser(self):

        # Create a unique tempdir for downloaded files
        tempdir = os.getenv(TEMPDIR_ENVVAR, DEFAULT_TEMPDIR)
        tempsubdir = uuid4().hex
        # TODO: Remove this directory when finished!
        self.tempdir = os.path.join(tempdir, tempsubdir)
        try:
            # Try and create directory before checking if it exists,
            # to avoid race condition
            os.makedirs(self.tempdir)
        except OSError:
            if not os.path.isdir(self.tempdir):
                raise

        profile = webdriver.FirefoxProfile()
        # Set download location, avoid download dialogues if possible
        # Different settings needed for different Firefox versions
        # This will be a long list...
        profile.set_preference('browser.download.folderList', 2)
        profile.set_preference('browser.download.manager.showWhenStarting', False)
        profile.set_preference('browser.download.manager.closeWhenDone', True)
        profile.set_preference('browser.download.dir', self.tempdir)
        profile.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/octet-stream;application/vnd.ms-excel")
        profile.set_preference("browser.helperApps.alwaysAsk.force", False)
        profile.set_preference("browser.download.manager.useWindow", False)

        self.browser = webdriver.Firefox(profile)

        self.browser.get('http://webbstat.av.se')
        detailed_cls = "Document_TX_GOTOTAB_Avancerad"
        

        # Wait for a content element, and 3 extra seconds just in case
        WebDriverWait(self.browser, PAGELOAD_TIMEOUT)\
            .until(EC.presence_of_element_located((By.CLASS_NAME,
                                                  detailed_cls)))
        self.browser.implicitly_wait(3)

        self.browser\
            .find_element_by_class_name(detailed_cls)\
            .find_element_by_tag_name("td")\
            .click()
        # Wait for a content element, and 3 extra seconds just in case
        WebDriverWait(self.browser, PAGELOAD_TIMEOUT)\
            .until(EC.presence_of_element_located((By.CLASS_NAME,
                                                   detailed_cls)))
        self.browser.implicitly_wait(3)
921467
def download(asset_type, dest, limit, sort, search_id, dry_run, activate_only,
             quiet, **kw):
    ''''''
    cl = clientv1()
    page_size = min(limit or 250, 250)
    asset_type = list(chain.from_iterable(asset_type))
    # even though we're using functionality from click.Path, this was needed
    # to detect inability to write on Windows in a read-only vagrant mount...
    # @todo check/report upstream
    if not activate_only and not check_writable(dest):
        raise click.ClickException(
            'download destination "%s" is not writable' % dest)
    if search_id:
        if dry_run:
            raise click.ClickException(
                'dry-run not supported with saved search')
        if any(kw[s] for s in kw):
            raise click.ClickException(
                'search options not supported with saved search')
        search, search_arg = cl.saved_search, search_id
    else:
        # any requested asset-types should be used as permission filters
        kw['asset_type'] = [AssetTypePerm.to_permissions(asset_type)]
        req = search_req_from_opts(**kw)
        if dry_run:
            req['interval'] = 'year'
            stats = cl.stats(req).get()
            item_cnt = sum([b['count'] for b in stats['buckets']])
            asset_cnt = item_cnt * len(asset_type)
            click.echo(
                'would download approximately %d assets from %s items' %
                (asset_cnt, item_cnt)
            )
            return
        else:
            search, search_arg = cl.quick_search, req

    dl = downloader.create(cl)
    output = downloader_output(dl, disable_ansi=quiet)
    # delay initial item search until downloader output initialized
    output.start()
    try:
        items = search(search_arg, page_size=page_size, sort=sort)
    except Exception as ex:
        output.cancel()
        click_exception(ex)
    func = dl.activate if activate_only else dl.download
    args = [items.items_iter(limit), asset_type]
    if not activate_only:
        args.append(dest)
    # invoke the function within an interrupt handler that will shut everything
    # down properly
    handle_interrupt(dl.shutdown, func, *args)
946340
def start_clicker( button, waitTime= 9, user_input=nil)
      # get a handle if one exists
      hwnd = @browser.enabled_popup(waitTime)
      if (hwnd)  # yes there is a popup
        w = WinClicker.new
        if ( user_input )
          w.setTextValueForFileNameField( hwnd, "#{user_input}" )
        end
        # I put this in to see the text being input it is not necessary to work
        sleep 3
        # "OK" or whatever the name on the button is
        w.clickWindowsButton_hwnd( hwnd, "#{button}" )
        #
        # this is just cleanup
        w = nil
      end
    end
140966
def click(self, loc=None, button=mouse.LEFT):
        
        if loc is not None:
            self.moveSpeed(loc)
        self._lock.acquire()
        mouse.click(button)
        self._lock.release()
1272030
def click_download(self, event):
		
		args ['parallel'] = self.p.get()
		args ['file_type'] = self.optionmenu.get()
		args ['no_redirects'] = self.t.get()
		args ['query'] = self.entry_query.get()
		args ['min_file_size'] = int( self.entry_min.get())
		args ['max_file_size'] = int( self.entry_max.get())
		args ['limit'] = int( self.entry_limit.get())
		args ['website']= self.entry_website.get()
		args ['option']= self.engine.get()
		print(args)
		self.check_threat()
		download_content_gui( **args )
547458
function downloadManager_close(force) {
    var windowCount = mozmill.utils.getWindows().length;

    if (this._controller) {
      // Check if we should force the closing of the DM window
      if (force) {
        this._controller.window.close();
      } else {
        var cmdKey = utils.getEntity(this.getDtds(), "cmd.close.commandKey");
        this._controller.keypress(null, cmdKey, {accelKey: true});
      }

      this._controller.waitForEval("subject.getWindows().length == " + (windowCount - 1),
                                   gTimeout, 100, mozmill.utils);
      this._controller = null;
    }
  }
1129308
def click(self, x, y):
        ''''''
        return self.server.jsonrpc.click(x, y)
1271345
function(download) {
      $("#addtrack").css("visibility","hidden");
      var element = document.getElementsByTagName('path')[0];
      element.setAttribute("stroke" , "black"); 
      element.setAttribute("fill" , "none");
      element = document.getElementsByTagName('line');
      for( var i=0 ; i<element.length ; i++)
      {
        element[i].setAttribute("stroke" , "black");
        element[i].setAttribute("fill" , "none");
          
      }
      var svgString = new XMLSerializer().serializeToString(document.querySelector(spec.timelineDiv+" svg"));
      var canvas = document.getElementById("canvas");
      var ctx = canvas.getContext("2d");
      var DOMURL = self.URL || self.webkitURL || self;
      var img = new Image();
      var svg = new Blob([svgString], {type: "image/svg+xml;charset=utf-8"});
      var url = DOMURL.createObjectURL(svg);
      img.onload = function() {
          ctx.drawImage(img, 0, 0);
          var png = canvas.toDataURL("image/png");
          document.querySelector("#png-container").innerHTML = '<img src="'+png+'"/>';
          var link = document.createElement("a");
          link.download = "clinical-timeline.png";
          if (download) {
            link.href = canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");
          }
          link.click();
          DOMURL.revokeObjectURL(png);
          link.remove();
      };
      img.src = url;
      $("#addtrack").css("visibility","visible");
    }
943780
def get(self):
        """"""
        method_name = "_download_" + self.name
        method = getattr(self, method_name)
        return method()
252878
def onFolderTreeClicked(self, proxyIndex):
        """"""
        if not proxyIndex.isValid():
            return

        index = self.proxyFileModel.mapToSource(proxyIndex)
        settings = QSettings()
        folder_path = self.fileModel.filePath(index)
        settings.setValue('mainwindow/workingDirectory', folder_path)
768096
public boolean clickOn(int index) {
		ImageItem item = getItem(index);
		if (item == null || TextUtils.isEmpty(item.mimeType)) {
			return false;
		}
		// For non-image items, the first tap will start it downloading
		if (!Util.isMimeTypeImage(item.mimeType)) {
			// It is being downloaded, do nothing (prevent double tap, etc)
			if (downloadItems.contains(item.originalPath)) {
				return true;
			} else {
				// If no write permission, do not try to download. Instead let caller handles it by launching browser
				if (!bHasWritePermission) {
					return false;
				}
				File localFile = new File(item.localCachePath);
				if (localFile.exists() && ApptentiveAttachmentLoader.getInstance().isFileCompletelyDownloaded(item.localCachePath)) {
					// If have right permission, and already downloaded, let caller open 3rd app to view it
					return false;
				} else {
					// First tap detected and never download before, start download
					downloadItems.add(item.originalPath);
					notifyDataSetChanged();
					return true;
				}
			}
		}
		return false;
	}