Serves up the consent in the popup window.
186877
def give_consent():
    
    if not ('hitId' in request.args and 'assignmentId' in request.args and
            'workerId' in request.args):
        raise ExperimentError('hit_assign_worker_id_not_set_in_consent')
    hit_id = request.args['hitId']
    assignment_id = request.args['assignmentId']
    worker_id = request.args['workerId']
    mode = request.args['mode']
    with open('templates/consent.html', 'r') as temp_file:
        consent_string = temp_file.read()
    consent_string = insert_mode(consent_string, mode)
    return render_template_string(
        consent_string,
        hitid=hit_id,
        assignmentid=assignment_id,
        workerid=worker_id
    )
960698
function openDialog (url) {
  const width = socialshares.config.dialog.width
  const height = socialshares.config.dialog.height

  // Center the popup
  const top = (window.screen.height / 2 - height / 2)
  const left = (window.screen.width / 2 - width / 2)

  window.open(url, 'Share', `width=${width},height=${height},top=${top},left=${left},menubar=no,toolbar=no,resizable=yes,scrollbars=yes`)
}
953400
public void acceptPrompt() {
        String action = "Clicking 'OK' on a prompt";
        String expected = "Prompt is present to be clicked";
        if (isNotPrompt(action, expected, "click")) {
            return;
        }
        accept(action, expected, "prompt");
    }
941220
function accept(req, res, cb) {
	var u = url.parse(req.url, true),
		path = u.pathname

	if(/^\/api\/?$/.test(path)) {
		messageInit({cb:(cb || nop), req:req, res:res, path:path, query:u.query, u:u})
		return;
	}

	if(req.method == "OPTIONS") {
		res.writeHead(200, {
			"Access-Control-Allow-Origin": "*",	// to support cross-domain script execution of our api
			"Access-Control-Max-Age": "0",
		})
		res.end()
		return;
	}

	www(req, res)					// everything else handled by paperboy
}
140933
public void acceptCertificate() {
        String action = "Clicking override link to accept ssl certificate";
        String result = "Override link clicked";
        //for IE and Edge
        if (browser.getName() == BrowserName.INTERNETEXPLORER || browser.getName() == BrowserName.EDGE) {
            Element overrideLink = newElement(Locator.ID, "overridelink");
            if (overrideLink.is().present()) {
                try {
                    if (browser.getName() == BrowserName.EDGE) {
                        newElement(Locator.ID, "moreInformationDropdownSpan").getWebElement().click();
                    }
                    overrideLink.getWebElement().click();
                    reporter.pass(action, result, result);
                } catch (Exception e) {
                    reporter.fail(action, result, "Unable to click override link. "
                            + e.getMessage());
                    log.warn(e);
                }
            }
        }
    }
442300
public function run()
	{
		echo '<html><head><title>Address consent result</title></head><body>';
		$noConsentResponse = $this->_getOrderReferenceDetailsWithoutAddressConsent();
		$this->_validateOrderReferenceIsInACorrectState($noConsentResponse);
		
		$consentResponse = $this->_getOrderReferenceDetailsWithAddressConsent();
		
		$this->_printOrderReferenceResponses($noConsentResponse, $consentResponse);
		echo '</body></html>';
	}
156657
private void showPermissionRequestDialog(final boolean gotoSettings) {
    new AlertDialog.Builder(this)
        .setTitle(R.string.permission_request)
        .setMessage(R.string.permission_explanation)
        .setNegativeButton(android.R.string.cancel, null)
        .setPositiveButton(gotoSettings ? R.string.go_to_settings : R.string.allow,
            new DialogInterface.OnClickListener() {
              @Override
              public void onClick(DialogInterface dialog, int which) {
                if (gotoSettings) {
                  startAppSettings();
                } else {
                  requestPermission();
                }
              }
            })
        .show();
  }
758939
def accept(self):
        """"""
        for index in range(self.stack.count()):
            self.stack.widget(index).accept_changes()
        QDialog.accept(self)
1171333
def allowed_to_accept_and_reject?(emendation)
      return unless emendation.amendment.evaluating?

      emendation.amendable.created_by?(current_user) || current_user.admin?
    end
1368755
protected void updateCloseBehavior() {

        if (isEnabled()) {
            if (!m_isValidTime && isValidTime()) {
                m_isValidTime = true;
                m_popup.setAutoHideEnabled(true);
            } else if (m_isValidTime && !isValidTime()) {
                m_isValidTime = false;
                m_popup.setAutoHideEnabled(false);
            }

            if (!m_isValidDateBox && isValideDateBox()) {
                m_isValidDateBox = true;
                if (m_autoHideParent != null) {
                    m_autoHideParent.removeAutoHidePartner(RootPanel.getBodyElement().getParentElement());
                }
            } else if (m_isValidDateBox && !isValideDateBox()) {
                m_isValidDateBox = false;
                if (m_autoHideParent != null) {
                    m_autoHideParent.addAutoHidePartner(RootPanel.getBodyElement().getParentElement());
                }
            }
        }
    }
513290
def new_popup_window(options, browser = "ie")
      if is_firefox?
        raise "not implemented"
      else
        if options[:url]
          Watir::IE.attach(:url, options[:url])
        elsif options[:title]
          Watir::IE.attach(:title, options[:title])
        else
          raise 'Please specify title or url of new pop up window'
        end
      end
    end
792853
def confirm_execution(self):
        """"""
        permit = ''
        while permit.lower() not in ('yes', 'no'):
            permit = input('Execute Proposed Plan? [yes/no] ')
        if permit.lower() == 'yes':
            return True
        else:
            return False
168935
public void acceptConfirmation() {
        String action = "Clicking 'OK' on a confirmation";
        String expected = "Confirmation is present to be clicked";
        if (isNotConfirmation(action, expected)) {
            return;
        }
        accept(action, expected, "confirmation");
    }
353505
private void accept(String action, String expected, String popup) {
        try {
            Alert alert = driver.switchTo().alert();
            alert.accept();
        } catch (Exception e) {
            reporter.fail(action, expected, "Unable to click 'OK' on the " + popup + ". " + e.getMessage());
            log.warn(e);
            return;
        }
        reporter.pass(action, expected, "Clicked 'OK' on the " + popup);
    }
152712
def set_popup_menu(self, menu):
        ''''''
        self.popup_menu = menu
        self.in_queue.put(MPImagePopupMenu(menu))
1240144
private void requestInputMode() {
        if (needInputMethod()) {
            Window window = dialog.getWindow();

            if (window != null) {
                window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
            }
        }
    }
997567
@Override
	public void handlePopups() {
		/*
		 * try { executeJavaScript("window.alert = function(msg){return true;};" +
		 * "window.confirm = function(msg){return true;};" +
		 * "window.prompt = function(msg){return true;};"); } catch (CrawljaxException e) {
		 * LOGGER.error("Handling of PopUp windows failed", e); }
		 */

		/* Workaround: Popups handling currently not supported in PhantomJS. */
		if (browser instanceof PhantomJSDriver) {
			return;
		}

		if (ExpectedConditions.alertIsPresent().apply(browser) != null) {
			try {
				browser.switchTo().alert().accept();
				LOGGER.info("Alert accepted");
			} catch (Exception e) {
				LOGGER.error("Handling of PopUp windows failed");
			}
		}
	}