opengrok-symbols-panel.js revision 1370
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* See LICENSE.txt included in this distribution for the specific
* language governing permissions and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at LICENSE.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Portions Copyright 2011, 2012, Jens Elkner.
*/
"use strict";
Y.WidgetButtons],
{ // instance members
BOUNDING_TEMPLATE : '<div id="symbolsBB"></div>',
CONTENT_TEMPLATE : '<div id="symbolsCB"></div>',
// private helpers
_getTop : function() { /* get optimal y position */
var h = Y.one('#whole_header');
},
_getLeft : function() { /* get optimal x position */
},
_getHeight: function() { /* get optimal height */
} else if (h < 50) {
h = 50;
}
return h;
},
_adjustPosition : function() {
// assure a minimum size of 50x50
if (w < 50) {
}
if (h < 50) {
}
// at least a part of the head should be visible for dragging
t = this.get('y');
} else if (t + 30 > bottom) {
}
t = this.get('x');
} else if (t + 50 > right) {
}
},
// public
initializer : function(config) {
this._listener = {};
var that = this;
if (e.target == this) {
that._fillHeight();
};
});
}
},
/**
* Hide the panel. It is different from just setting the 'visible'
* property: unneeded listeners are removed from the panel after it
* has been hidden.
* @Override
*/
hide : function() {
}
}
},
/**
* Show the panel. It is different from just setting the 'visible'
* property: adjusts the position of the panel if necessary, syncs the
* height of the fillSection (default: body) and adds additional
* listeners before making it visible.
* @Override
*/
show : function() {
var that = this;
// a little hack for people who wanna play with resize
return false;
}
if (style != 'both') {
}
});
that._fillHeight();
});
this._adjustPosition();
this._fillHeight();
}
}
}, {
// static
ATTRS: {
/* @attribute {Integer} preferred width of the panel */
pWidth : {
value: 240,
},
/* @attribute {Integer} preferred height of the panel */
pHeight : {
value: 480,
},
/* @attribute {} preferred distance of the panel incl. margins to
* its "container" - used for positioning only. Invalid values are
* treated as 0. */
pMargin : {
}
return {
};
}
if (L.isObject) {
return {
}
}
}
},
/* @attribute {Integer} CSS z-index value */
zIndex : {
value: 100
}
},
/**
* Create a node suitable to be used as <var>srcNode</var> aka content
* box for an instance of SymbolPanel. The format for the symbolClass
* parameter is as follows:
* <pre>
* symbolClass = '[' Section[','Section]*']'
* Section = '[' SectionName',' CssClassName',' '[' Entry[',' Entry]* ']'']'
* Entry = '[' SymbolName',' LineNumber ']'
* *Name = <String>
* *Number = <Integer>
* </pre>
* @param symbolClass symbol classes to use to create the body of the
* panel.
* @param title the text to show in the head of the content box.
* @return a non-<code>null</code> node.
*/
symbolClass || (symbolClass = []);
var contents = "<div id='symbolsCB'>"
+ "<div id='symbolsHd' class='yui3-widget-hd'><h3>" + title
+ "</h3></div>"
+ "<div id='symbols' class='yui3-widget-bd'>";
var symbol_class = symbolClass[i];
}
contents += "</ul>"
}
contents += "</div>"
+ "<div id='symbolsFt' class='yui3-widget-ft'></div></div>"
}
});
Y.SymbolsPanel = panel;
}, '3.5.0pr2', {
'widget-position', 'widget-stack', 'widget-stdmod',
'dd-plugin', 'escape']
});