Exemplo n.º 1
0
 public static function style()
 {
     $css = ar_css::stylesheet()->import("\n\t\t\t\thtml.js .diff-js-hidden { display:none; }\n\t\t\t\t.diff-inline-metadata {\n\t\t\t\t  padding:4px;\n\t\t\t\t  border:1px solid #ddd;\n\t\t\t\t  background:#fff;\n\t\t\t\t  margin:0px 0px 10px;\n\t\t\t\t  }\n\n\t\t\t\t.diff-inline-legend { font-size:11px; }\n\n\t\t\t\t.diff-inline-legend span,\n\t\t\t\t.diff-inline-legend label { margin-right:5px; }\n\n\t\t\t\t/**\n\t\t\t\t * Inline diff markup\n\t\t\t\t */\n\t\t\t\tspan.diff-deleted { color:#ccc; }\n\t\t\t\tspan.diff-deleted img { border: solid 2px #ccc; }\n\t\t\t\tspan.diff-changed { background:#ffb; }\n\t\t\t\tspan.diff-changed img { border:solid 2px #ffb; }\n\t\t\t\tspan.diff-added { background:#cfc; }\n\t\t\t\tspan.diff-added img { border: solid 2px #cfc; }\n\n\t\t\t\t/**\n\t\t\t\t * Traditional split diff theming\n\t\t\t\t */\n\t\t\t\ttable.diff {\n\t\t\t\t  border-spacing: 0px;\n\t\t\t\t  border-collapse: collapse;\n\t\t\t\t  margin-bottom: 20px;\n\t\t\t\t  width: 100%;\n\t\t\t\t  table-layout: fixed;\n\t\t\t\t}\n\t\t\t\ttable.diff col {\n\t\t\t\t\twidth: 1.4em;\n\t\t\t\t}\n\t\t\t\ttable.diff col.content {\n\t\t\t\t\twidth: 50%;\n\t\t\t\t}\n\t\t\t\ttable.diff tr.even, table.diff tr.odd {\n\t\t\t\t  background-color: inherit;\n\t\t\t\t  border: none;\n\t\t\t\t}\n\t\t\t\ttd.diff-prevlink {\n\t\t\t\t  text-align: left;\n\t\t\t\t}\n\t\t\t\ttd.diff-nextlink {\n\t\t\t\t  text-align: right;\n\t\t\t\t}\n\t\t\t\ttd.diff-section-title, div.diff-section-title {\n\t\t\t\t  background-color: #f0f0ff;\n\t\t\t\t  font-size: 0.83em;\n\t\t\t\t  font-weight: bold;\n\t\t\t\t  padding: 0.1em 1em;\n\t\t\t\t}\n\t\t\t\ttable.diff td {\n\t\t\t\t\tvertical-align: top;\n\t\t\t\t\tborder-bottom: 1px solid #CCCCCC;\n\t\t\t\t}\n\n\t\t\t\ttd.diff-deletedline {\n\t\t\t\t  background-color: #ffa;\n\t\t\t\t  width: 50%;\n\t\t\t\t}\n\t\t\t\ttd.diff-addedline {\n\t\t\t\t  background-color: #afa;\n\t\t\t\t  width: 50%;\n\t\t\t\t}\n\t\t\t\ttd.diff-context {\n\t\t\t\t  background-color: #fafafa;\n\t\t\t\t}\n\t\t\t\tspan.diffchange {\n\t\t\t\t  color: #f00;\n\t\t\t\t  font-weight: bold;\n\t\t\t\t}\n\n\t\t\t\ttable.diff col.diff-marker {\n\t\t\t\t  width: 1.4em;\n\t\t\t\t}\n\t\t\t\ttable.diff col.diff-content {\n\t\t\t\t  width: 50%;\n\t\t\t\t}\n\t\t\t\ttable.diff th {\n\t\t\t\t  padding-right: inherit;\n\t\t\t\t}\n\t\t\t\ttable.diff td div {\n\t\t\t\t  overflow: auto;\n\t\t\t\t  padding: 0.1ex 0.5em;\n\t\t\t\t  word-wrap: break-word;\n\t\t\t\t}\n\t\t\t\ttable.diff td {\n\t\t\t\t  padding: 0.1ex 0.4em;\n\t\t\t\t}\n\t\t\t");
     return $css;
 }
Exemplo n.º 2
0
 public function __construct($tagName = 'ul', $attributes = array(), $childNodes = null, $parentNode = null)
 {
     if (!$attributes['class'] && !$attributes['id']) {
         $attributes['class'] = 'menu';
     }
     if (!$tagName) {
         $tagName = 'ul';
     }
     $this->options['listTag'] = $tagName;
     switch ($tagName) {
         case 'ul':
         case 'ol':
             $this->options['itemTag'] = 'li';
             break;
         case 'dl':
             $this->options['itemTag'] = 'dt';
             break;
         default:
             $this->options['itemTag'] = $tagName;
             break;
     }
     if (!$childNodes instanceof ar_htmlNodes) {
         $childNodes = null;
     }
     parent::__construct($tagName, $attributes, $childNodes, $parentNode);
     $this->items['[root]'] = $this;
     $context = ar::context();
     $me = $context->getObject();
     if ($me) {
         $this->root = $me->currentsite();
         $this->rooturl = $me->make_local_url($this->root);
     }
     if (!isset($this->root)) {
         $this->root = '/';
         $this->rooturl = '/';
     }
     $this->current = $this->root;
     $listTag = $this->options['listTag'];
     $itemTag = $this->options['itemTag'];
     if ($this->attributes['id']) {
         $prefix = '#' . $this->attributes['id'];
     } else {
         $prefix = $listTag . '.' . $this->attributes['class'];
     }
     $this->prefix = $prefix;
     $this->css = ar_css::stylesheet()->import("\n\t\t\t\t{$prefix}, {$prefix} {$listTag} {\n\t\t\t\t\tlist-style: none;\n\t\t\t\t\tmargin: 0px;\n\t\t\t\t\tpadding: 0px;\n\t\t\t\t}\n\n\t\t\t\t{$prefix} {$itemTag} {\n\t\t\t\t\tmargin: 0px;\n\t\t\t\t\tpadding: 0px;\n\t\t\t\t}\n\n\t\t\t\t{$prefix} {$itemTag} a {\n\t\t\t\t\ttext-decoration: none;\n\t\t\t\t}\n\t\t\t");
 }