views-css-inspector.js
Summary
No overview generated for 'views-css-inspector.js'
var cls = window.cls || ( window.cls = {} );
cls.CSSInspectorView = function(id, name, container_class)
{
var self = this;
this.createView = function(container)
{
container.innerHTML ='';
var cats = elementStyle.getCategories(), cat_key = '', cat = null, i = 0;
container.render(templates.cssInspector(cats));
for( ; cat = cats[i]; i++)
{
cat_key += cat.unfolded ? '1' : '0';
}
this.updateCategories({}, cat_key);
}
this.updateCategories = function(ev, cats)
{
if( self.isvisible() )
{
if(ev.__call_count && ev.__call_count > 2 )
{
opera.postError('failed updateCategories, missing indexMap, views-css-inspector')
return;
}
var containers = self.getAllContainers(), c = null , i = 0;
var styles = null, s_c = null , cat_index = 0, data = null;
var search_active = elementStyle.getSearchActive();
for( ; c = containers[i]; i++)
{
styles = c.getElementsByTagName('styles');
if( !styles.length )
{
this.createView(c);
return;
}
for( cat_index = 0; cat_index < 2; cat_index++ )
{
if( cats[cat_index] == '1' )
{
data = elementStyle.getCategoryData(cat_index);
if( data )
{
styles[cat_index].innerHTML =
stylesheets.prettyPrintCat(cat_index, data, arguments, search_active);
styles[cat_index].setAttribute('rt-id', data.rt_id);
}
}
}
}
}
}
this.init(id, name, container_class);
}
cls.CSSInspectorView.prototype = ViewBase;
new cls.CSSInspectorView('css-inspector', ui_strings.M_VIEW_LABEL_STYLES, 'scroll css-inspector');
new Settings
(
'css-inspector',
{
'computedStyle': false,
'css': true,
'hide-initial-values': true,
'hide-shorthands': true
},
{
'hide-initial-values': ui_strings.S_SWITCH_SHOW_INITIAL_VALUES,
'hide-shorthands': ui_strings.S_SWITCH_SHOW_SHORTHANDS
},
{
checkboxes:
[
'hide-initial-values',
'hide-shorthands',
]
}
);
new ToolbarConfig
(
'css-inspector',
null,
[
{
handler: 'css-inspector-text-search',
title: 'text search',
label: ui_strings.S_INPUT_DEFAULT_TEXT_FILTER
}
]
)
new Switches
(
'css-inspector',
[
'hide-initial-values',
'hide-shorthands',
]
)
Documentation generated by
JSDoc on Thu Oct 30 18:01:10 2008