Lines Matching defs:this

4  * The contents of this file are subject to the terms of the
6 * You may not use this file except in compliance with the License.
8 * See LICENSE.txt included in this distribution for the specific
11 * When distributing Covered Code, include this CDDL HEADER in each
13 * If applicable, add the following below this CDDL HEADER, with the
37 * of this plugin for really long files.
49 if (!$(this).hasClass("selected")) {
50 $(this).addClass("selected");
51 $(this).text($(this).text() + " ");
156 this.init = function (options) {
159 return this;
170 self: this,
188 var val = inner.toInt($(this).attr("name"))
306 var $el = $(this)
323 this.init = function (options) {
325 return this;
342 return this;
353 var self = this
354 this.scriptsDownloaded = {};
355 this.defaults = {
359 this.options = $.extend(this.defaults, {});
361 this.loadScript = function (url) {
363 url = this.options.contextPath + '/' + url
365 if (url in this.scriptsDownloaded) {
366 return this.scriptsDownloaded[url]
368 return this.scriptsDownloaded[url] = $.ajax({
389 * // default options (later available via this.options)
407 * // it's available in the callbacks as the 'this' variable
408 * // the window itself is available as this.$window
411 * this.modified = true;
420 * $myWindow.error(message) to display an error in this.$errors element or
430 var self = this;
432 this.context = context;
433 this.callbacks = {
438 this.$window = undefined;
439 this.$errors = undefined;
440 this.clientX = 0;
441 this.clientY = 0;
442 this.pendingUpdates = []
447 this.defaults = {
459 this.options = $.extend({}, this.defaults, options);
461 this.addCallback = function (name, callback, context) {
462 context = context || this.getSelfContext;
463 if (!this.callbacks || !$.isArray(this.callbacks[name])) {
464 this.callbacks[name] = []
466 this.callbacks[name].push({
472 this.fire = function (name, args) {
473 if (!this.callbacks || !$.isArray(this.callbacks[name])) {
477 for (var i = 0; i < this.callbacks[name].length; i++) {
478 this.$window = (this.callbacks[name][i].callback.apply(
479 this.callbacks[name][i].context.call(this),
480 args || [this.$window])) || this.$window
484 this.getContext = function () {
485 return $.extend(this.context, {options: this.options});
488 this.getSelfContext = function () {
489 return this;
493 this.determinePosition = function () {
495 var $w = this.$window;
496 if (this.clientY + $w.height() + 40 > $(browserWindow).height()) {
499 position.top = this.clientY
501 if (this.clientX + $w.width() + 40 > $(browserWindow).width()) {
504 position.left = this.clientX;
509 this.makeMeDraggable = function () {
515 $script.loadScript(this.options.draggableScript).done(function () {
520 $(this).hide();
523 $(this).show().offset(ui.offset).css('position', 'fixed');
526 $(this).css('position', 'fixed');
532 this.addCallback('init', function ($window) {
536 .append($("<div>").addClass("pull-left").append($("<b>").text(this.options.title || "Window")))
569 return this;
581 return this.css(position);
590 return this.toggle().move();
600 if (this.loaded) {
605 return this;
609 this.context = $.extend(this.context, {$window: $window});
619 this.addCallback('load', function ($window) {
620 var that = this
637 if (this.options.draggable) {
638 this.addCallback('load', this.makeMeDraggable)
641 this.addCallback('load', function ($window) {
642 this.$window.appendTo(this.options.parent ? $(this.options.parent) : $("body"));
645 if (this.options.init && typeof this.options.init === 'function') {
646 this.addCallback('init', this.options.init, this.getContext)
650 this.addCallback('load', this.options.load, this.getContext)
654 this.addCallback('update', this.options.update, this.getContext)
667 this.fire('init')
669 return this.$window;
679 this.create = function (options, context) {
698 this.initialised = false;
699 this.init = function (options, context) {
719 this.bindOnClick($highlight, this.highlight)
720 this.bindOnClick($unhighlight, this.unhighlight)
721 this.bindOnClick($unhighlighAll, this.unhighlightAll);
747 .append(this.$errors = $("<span class=\"clearfix\">"))
749 this.bindOnClick($next, this.scrollToNextElement, 1);
750 this.bindOnClick($prev, this.scrollToNextElement, -1);
761 .append($("<h5>").text("In project \"" + this.project + "\""))
767 var that = this;
794 this.getSymbols().mouseover(function () {
795 that.changeSymbol($(this));
797 this.project = this.options.project || $("input[name='project']").val();
798 this.contextPath = browserWindow.contextPath;
812 this.$current = $el
813 this.$last_highlighted_current = $el.hasClass("symbol-highlighted") ? $el : this.$last_highlighted_current
814 this.symbol = $el.text()
815 this.place = $el.data("definition-place")
816 this.$window.find('.hidden-on-start').show()
817 this.$window.find(".symbol-name").text(this.symbol);
818 this.$window.find(".symbol-description").text(this.getSymbolDescription(this.place))
819 this.modifyLinks();
822 this.$search_defs = this.$search_defs || this.$window.find('.search-defs')
823 this.$search_refs = this.$search_refs || this.$window.find('.search-refs')
824 this.$search_full = this.$search_full || this.$window.find('.search-full')
825 this.$search_files = this.$search_files || this.$window.find('.search-files')
826 this.$search_google = this.$search_google || this.$window.find('.search-google')
828 this.$search_defs.attr('href', this.getSearchLink('defs'));
829 this.$search_refs.attr('href', this.getSearchLink('refs'));
830 this.$search_full.attr('href', this.getSearchLink('q'));
831 this.$search_files.attr('href', this.getSearchLink('path'));
832 this.$search_google.attr('href', this.options.google_url + this.symbol)
835 return this.options.contextPath + '/search?' + query + '=' + this.symbol + '&project=' + this.project;
842 return "A symbol declared or defined in this file.";
851 return (this.$symbols = this.$symbols || $(this.options.selector));
854 if (this.$current.text() === symbol) {
855 this.$last_highlighted_current = this.$current;
857 return this.getSymbols().filter(function () {
858 return $(this).text() === symbol;
862 if (this.$last_highlighted_current &&
863 this.$last_highlighted_current.text() === symbol &&
864 this.$last_highlighted_current.hasClass('symbol-highlighted')) {
865 var i = this.getSymbols().index(this.$last_highlighted_current)
866 this.$last_highlighted_jump = this.getSymbols().slice(0, i).filter('.symbol-highlighted').last();
868 return this.getSymbols().filter(".symbol-highlighted").filter(function () {
869 return $(this).text() === symbol;
874 this.$last_highlighted_current = undefined
875 return this.getSymbols().filter(".symbol-highlighted").removeClass("symbol-highlighted")
878 if (this.options.scrollTop) {
879 this.options.scrollTop($el)
889 var $highlighted = this.getSymbols().filter(".symbol-highlighted");
890 var $el = $highlighted.length && this.$last_highlighted_current
891 ? this.$last_highlighted_current
892 : this.$current;
893 var indexOfCurrent = this.getSymbols().index($el);
897 $el = this.getSymbols().slice(indexOfCurrent + 1);
902 this.$window.error("This is the last occurence!")
908 $el = this.getSymbols().slice(0, indexOfCurrent);
913 this.$window.error("This is the first occurence!")
919 this.$window.error("Uknown direction")
923 this.scrollTop($el)
924 this.changeSymbol($el)
927 var that = this
952 this.init = function (options, context) {
962 .append(this.$messages = $("<div>"))
973 var old = $window[this]
974 $window[this] = function () {
980 this.$messages.empty()
986 this.$messages.append($("<h5>")
1002 this.$messages.append($ul);
1025 this.init = function (options, context) {
1035 .append(this.$scopes = $("<div>"))
1042 var event = this
1050 if(!this.$window.is(':visible') && !this.$window.data('shown-once')) {
1051 this.$window.show().data('shown-once', true);
1053 this.$scopes.empty()
1054 this.$scopes.html(this.buildLink(data.id, data.link))
1095 this.$selectionContainer.find("[data-messages]").mouseenter(function () {
1096 var data = $(this).data('messages') || []
1107 var posY = this.$input.offset().top - this.config.scrollTarget.scrollTop() + this.$input.outerHeight() + 1,
1108 selectionContainerWidth = this.$innerContainer.outerWidth(false) - parseInt(this.$selectionContainer.css('border-left-width'), 10) - parseInt(this.$selectionContainer.css('border-right-width'), 10);
1110 if (this.$innerContainer.css('display') !== 'block') {
1116 this.$selectionContainer
1119 if (this.$actionButtons) {
1120 this.$actionButtons
1125 this.$selectionContainer
1127 .css('left', Math.floor(this.$container.offset().left))
1138 var $this = $(this)
1140 $(this).attr('href', setParameter($(this).attr('href'), 'r1', $this.data('revision-1')))
1141 $(this).attr('href', setParameter($(this).attr('href'), 'r2', $this.data('revision-2')))
1150 .data('revision-2', $this.data('revision-2'))
1152 .data('revision-1', $this.data('revision-1'))
1155 $("#input_" + $this.data('diff-revision')).val($this.data('revision-path'))
1160 $revisions.filter('[data-diff-revision=\'' + $this.data('diff-revision') + '\']').prop('checked', false)
1162 $this.prop('checked', true)
1195 var $that = $(this);
1199 var $thet = $(this)
1205 url: $(this).data('markdown-download'),
1256 var data = $(this).data('messages') || []
1272 * Initialize the window hash management. Mainly this allows users to select
1303 * could occur in the readmes then rather comment out this.
1318 for(var i in this.domReady) {
1403 var element = $(this);
1666 var pattern = new RegExp("("+this+")", ["gi"]);
1704 if (this.className == "filelist") {
1705 this.setAttribute("style", "display: none;");
1706 this.className = "filelist-hidden";
1707 } else if (this.className == "filelist-hidden") {
1708 this.setAttribute("style", "display: inline;");
1709 this.className = "filelist";
1718 if (this.className == "revtags") {
1719 this.setAttribute("style", "display: none;");
1720 this.className = "revtags-hidden";
1721 } else if (this.className == "revtags-hidden") {
1722 this.setAttribute("style", "display: table-row;");
1723 this.className = "revtags";
1729 if (this.className == "revtags") {
1730 this.setAttribute("style", "display: none;");
1731 this.className = "revtags-hidden";
1732 } else if (this.className == "revtags-hidden") {
1733 this.setAttribute("style", "display: inline;");
1734 this.className = "revtags";
1745 var toggleState = $(this).closest(closestType).attr("data-toggle-state");
1746 var thisCell = $(this).closest("td");
1749 $(this).closest(closestType).attr("data-toggle-state", "more");
1752 $(this).html("... show less");
1755 $(this).closest(closestType).attr("data-toggle-state", "less");
1758 $(this).html("show more ...");
1791 $(this).prop('selected', !$(this).prop('selected'));
1806 $(this).val("");