generates the html structure for list of scopes
508846
function generateScopeList(hiddenValues){
		hiddenValues = hiddenValues || [];
		var htmlString = "";
		var ieClass = util.isIE ? "-ie" : ""; //$NON-NLS-0$

		for (var i = 0; i < scopeList.length; i++){
			if (scopeList[i].id === "editorThemeFontSize"){
				htmlString = htmlString + "<li><label for='editorThemeFontSize'>" + scopeList[i].display + "</label><select id='editorThemeFontSize'>";
				for (var l = 8; l < 19; l++){
					htmlString = htmlString + "<option value='" + l+"px'>"+l+"px</option>";
				}
				for(l = 8; l < 19; l++){
					htmlString = htmlString + "<option value='" + l+"pt'>"+l+"pt</option>";
				}
				htmlString += "</select></li>";//$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
			}
			else {
				var hideValueCSS = hiddenValues.indexOf(scopeList[i].id) >= 0 ? "style='display: none'" : ""; //$NON-NLS-0$
				htmlString = htmlString + "<li " + hideValueCSS + "><label for='"+scopeList[i].id+"' id='"+scopeList[i].id+"Label'>" + scopeList[i].display + "</label><input id='"+scopeList[i].id+"' aria-labelledby='" + scopeList[i].id + "Label " + scopeList[i].id + "' class='colorpicker-input" + ieClass + "' type='color' value='" + scopeList[i].value + "'></li>";//$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
			}
		}
		return htmlString;
	}
1335983
def to_html(options = {})
      html = []
      self.items.each do |item|
        html << item.to_html(options)
      end
      html.join
    end
450737
def new_scope(self, new_scope={}):
        
        old_scopes, self.scopes = self.scopes, self.scopes.new_child(new_scope)
        yield
        self.scopes = old_scopes
461077
def generate_class_list(classes, modules, from, html_file, class_dir)
      if from.is_module? and !@modules.has_key?(from.name)
        k = HTMLPuppetModule.new(from, html_file, class_dir, @options)
        classes << k
        @modules[from.name] = k
        modules << @modules[from.name]
      elsif from.is_module?
        modules << @modules[from.name]
      elsif !from.is_module?
        k = HTMLPuppetClass.new(from, html_file, class_dir, @options)
        classes << k
      end
      from.each_classmodule do |mod|
        generate_class_list(classes, modules, mod, html_file, class_dir)
      end
    end
1157318
function setScopeValues(scope, attrs) {
                scope.List = [];
                scope.Hide = false;
                scope.page = parseInt(scope.page) || 1;
                scope.total = parseInt(scope.total) || 0;
                scope.dots = scope.dots || '...';
                scope.ulClass = scope.ulClass || attrs.ulClass || 'pagination';
                scope.adjacent = parseInt(scope.adjacent) || 2;
                scope.activeClass = 'active';
                scope.disabledClass = 'disabled';

                scope.scrollTop = scope.$eval(attrs.scrollTop);
                scope.hideIfEmpty = scope.$eval(attrs.hideIfEmpty);
                scope.showPrevNext = scope.$eval(attrs.showPrevNext);
                scope.useSimplePrevNext = scope.$eval(attrs.useSimplePrevNext);
            }
442711
def generate_table(collection, headers=nil, options={})
      return if collection.blank?
      thead = content_tag(:thead) do
        content_tag(:tr) do
          headers.map {|header| content_tag(:th, header)}
        end
      end unless headers.nil?
      tbody = content_tag(:tbody) do
        collection.map do |values|
          content_tag(:tr) do
            values.map {|value| content_tag(:td, value)}
          end
        end
      end
      content_tag(:table, [thead, tbody].compact.join("\n"), options)
    end
1198645
def _generate_list_heading(self):
        

        local = self.parser.find('body').first_result()
        id_container_heading_before = (
            AccessibleNavigationImplementation.ID_CONTAINER_HEADING_BEFORE
        )
        id_container_heading_after = (
            AccessibleNavigationImplementation.ID_CONTAINER_HEADING_AFTER
        )
        if local is not None:
            container_before = self.parser.find(
                '#'
                + id_container_heading_before
            ).first_result()
            if (container_before is None) and (self.elements_heading_before):
                container_before = self.parser.create_element('div')
                container_before.set_attribute(
                    'id',
                    id_container_heading_before
                )

                text_container_before = self.parser.create_element('span')
                text_container_before.set_attribute(
                    'class',
                    AccessibleNavigationImplementation.CLASS_TEXT_HEADING
                )
                text_container_before.append_text(self.elements_heading_before)

                container_before.append_element(text_container_before)
                local.prepend_element(container_before)
            if container_before is not None:
                self.list_heading_before = self.parser.find(
                    container_before
                ).find_children('ol').first_result()
                if self.list_heading_before is None:
                    self.list_heading_before = self.parser.create_element('ol')
                    container_before.append_element(self.list_heading_before)

            container_after = self.parser.find(
                '#'
                + id_container_heading_after
            ).first_result()
            if (container_after is None) and (self.elements_heading_after):
                container_after = self.parser.create_element('div')
                container_after.set_attribute('id', id_container_heading_after)

                text_container_after = self.parser.create_element('span')
                text_container_after.set_attribute(
                    'class',
                    AccessibleNavigationImplementation.CLASS_TEXT_HEADING
                )
                text_container_after.append_text(self.elements_heading_after)

                container_after.append_element(text_container_after)
                local.append_element(container_after)
            if container_after is not None:
                self.list_heading_after = self.parser.find(
                    container_after
                ).find_children('ol').first_result()
                if self.list_heading_after is None:
                    self.list_heading_after = self.parser.create_element('ol')
                    container_after.append_element(self.list_heading_after)
        self.list_heading_added = True
847768
private void fillScopeCodes(
            NodeList scopeNodeList,
            Map<String, Scope> scopes,
            Map<String, Code> codes
    ) {
        for (int i = 0; i < scopeNodeList.getLength(); i++) {
            Element scopeElement = (Element) scopeNodeList.item(i);
            Scope scope = scopes.get(scopeElement.getAttribute(TAG_SCOPE_ATTR_NAME));

            // Add codes to scope
            Set<Code> scopeCodes = new HashSet<Code>();

            // bind exists codes
            NodeList coderefs = scopeElement.getElementsByTagNameNS(SCHEMA_LOCATION, TAG_CODEREF);
            for (int j = 0; j < coderefs.getLength(); j++) {
                Element ref = (Element) coderefs.item(j);
                String codeName = ref.getAttribute(TAG_CODEREF_ATTR_NAME);
                Code code = codes.get(codeName);
                if (code == null) {
                    throw new TextProcessorFactoryException("Can't find code \"" + codeName + "\".");
                }
                scopeCodes.add(code);
            }

            // Add inline codes
            NodeList inlineCodes = scopeElement.getElementsByTagNameNS(SCHEMA_LOCATION, TAG_CODE);
            for (int j = 0; j < inlineCodes.getLength(); j++) {
                // Inline element code
                Element ice = (Element) inlineCodes.item(j);
                scopeCodes.add(parseCode(ice, scopes));
            }

            // Set codes to scope
            scope.setCodes(scopeCodes);
        }
    }
835587
function(node, scope) {
    var delim
      , stmt
      , next
      , block = this.parent = new nodes.Block(this.parent, node);

    if (false === scope) block.scope = false;

    this.accept('newline');

    // css-style
    if (this.accept('{')) {
      this.css++;
      delim = '}';
      this.skipWhitespace();
    } else {
      delim = 'outdent';
      this.expect('indent');
    }

    while (delim != this.peek().type) {
      // css-style
      if (this.css) {
        if (this.accept('newline') || this.accept('indent')) continue;
        stmt = this.statement();
        this.accept(';');
        this.skipWhitespace();
      } else {
        if (this.accept('newline')) continue;
        // skip useless indents and comments
        next = this.lookahead(2).type;
        if ('indent' == this.peek().type
          && ~['outdent', 'newline', 'comment'].indexOf(next)) {
          this.skip(['indent', 'outdent']);
          continue;
        }
        if ('eos' == this.peek().type) return block;
        stmt = this.statement();
        this.accept(';');
      }
      if (!stmt) this.error('unexpected token {peek} in block');
      block.push(stmt);
    }

    // css-style
    if (this.css) {
      this.skipWhitespace();
      this.expect('}');
      this.skipSpaces();
      this.css--;
    } else {
      this.expect('outdent');
    }

    this.parent = block.parent;
    return block;
  }
54523
def scope_compose(scope, name, sep=private.SCOPE_SEPARATOR):
    

    if name == None:
        new_scope = scope
    else:
        new_scope = scope if scope else name

    if scope and name:
        new_scope = scope + sep + name

    return new_scope
868110
public List<String> iterateScopeNameList() {
        log.debug("iterateScopeNameList called");
        Collection<IScope> scopes = getScopes();
        log.debug("Scopes: {}", scopes.size());
        List<String> scopeNames = new ArrayList<String>(scopes.size());
        for (IScope scope : scopes) {
            log.debug("Client scope: {}", scope);
            scopeNames.add(scope.getName());
            if (log.isDebugEnabled()) {
                for (Map.Entry<String, Object> entry : scope.getAttributes().entrySet()) {
                    log.debug("Client scope attr: {} = {}", entry.getKey(), entry.getValue());
                }
            }
        }
        return scopeNames;
    }
366503
def format_options(self, scope, description, option_registrations_iter):
    
    oshi = HelpInfoExtracter(self._scope).get_option_scope_help_info(option_registrations_iter)
    lines = []
    def add_option(category, ohis):
      if ohis:
        lines.append('')
        display_scope = scope or 'Global'
        if category:
          lines.append(self._maybe_blue('{} {} options:'.format(display_scope, category)))
        else:
          lines.append(self._maybe_blue('{} options:'.format(display_scope)))
          if description:
            lines.append(description)
        lines.append(' ')
        for ohi in ohis:
          lines.extend(self.format_option(ohi))
    add_option('', oshi.basic)
    if self._show_recursive:
      add_option('recursive', oshi.recursive)
    if self._show_advanced:
      add_option('advanced', oshi.advanced)
    return lines
715127
def show_for object, html_options = {}, &block
      html_options = html_options.dup

      tag = html_options[:list_tag] || IndexFor.list_tag

      html_options[:id] ||= show_for_id(object)
      html_options[:class] = show_for_class(object, html_options)

      builder = html_options[:builder] || IndexFor::ListColumnBuilder
      content = capture(builder.new(object, html_options, self), &block)

      content_tag(tag, content, html_options)
    end
543143
def gen_checkbox_list(sig_dic):
    '''
    
    '''
    view_zuoxiang = '''<span class="iga_pd_val">'''

    dic_tmp = sig_dic['dic']
    for key in dic_tmp.keys():
        tmp_str = '''{{% if "{0}" in postinfo.extinfo["{1}"] %}} {2}  {{% end %}}
        '''.format(key, sig_dic['en'], dic_tmp[key])
        view_zuoxiang += tmp_str

    view_zuoxiang += '''</span>'''
    return view_zuoxiang
563551
def render_with_scope(scope = nil, action = self.action_name, path = self.controller_path)
        templates = [ [path, action] ]
        templates << [path, scope, action] if scope
        
        if Sunrise::Config.scoped_views?
          templates << [path, abstract_model.plural, scope, action]
        end
        
        templates.reverse.each do |keys|
          name = File.join(*keys.compact.map(&:to_s))
          return render(:template => name) if template_exists?(name)
        end
      end
497946
def href_of(scope, selector)
      if node = scope.css(selector).first
        node.attr('href')
      end
    end
1317578
def html_list(data):
    """"""
    if data is None:
        return None
    as_li = lambda v: "<li>%s</li>" % v
    items = [as_li(v) for v in data]
    return mark_safe("<ul>%s</ul>" % ''.join(items))