Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions deps/rabbitmq_management/priv/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<script src="js/base64.js" type="text/javascript"></script>
<script src="js/global.js" type="text/javascript"></script>
<script src="js/main.js" type="text/javascript"></script>
<script src="js/title.js" type="text/javascript"></script>
<script src="js/prefs.js" type="text/javascript"></script>
<script src="js/formatters.js" type="text/javascript"></script>
<script src="js/charts.js" type="text/javascript"></script>
Expand Down
66 changes: 0 additions & 66 deletions deps/rabbitmq_management/priv/www/js/dispatcher.js
Original file line number Diff line number Diff line change
@@ -1,69 +1,3 @@
(function (factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery', 'sammy'], factory);
} else {
(window.Sammy = window.Sammy || {}).Title = factory(window.jQuery, window.Sammy);
}
}(function ($, Sammy) {

// Sammy.Title is a very simple plugin to easily set the document's title.
// It supplies a helper for setting the title (`title()`) within routes,
// and an app level method for setting the global title (`setTitle()`)
Sammy.Title = function() {

// setTitle allows setting a global title or a function that modifies the
// title for each route/page.
//
// ### Example
//
// // setting a title prefix
// $.sammy(function() {
//
// this.setTitle('My App -');
//
// this.get('#/', function() {
// this.title('Home'); // document's title == "My App - Home"
// });
// });
//
// // setting a title with a function
// $.sammy(function() {
//
// this.setTitle(function(title) {
// return [title, " /// My App"].join('');
// });
//
// this.get('#/', function() {
// this.title('Home'); // document's title == "Home /// My App";
// });
// });
//
this.setTitle = function(title) {
if (!$.isFunction(title)) {
this.title_function = function(additional_title) {
return [title, additional_title].join(' ');
}
} else {
this.title_function = title;
}
};

// *Helper* title() sets the document title, passing it through the function
// defined by setTitle() if set.
this.helper('title', function() {
var new_title = $.makeArray(arguments).join(' ');
if (this.app.title_function) {
new_title = this.app.title_function(new_title);
}
document.title = new_title;
});

};

return Sammy.Title;

}));

dispatcher_add(function(sammy) {
function path(p, r, t) {
sammy.get(p, function() {
Expand Down
64 changes: 64 additions & 0 deletions deps/rabbitmq_management/priv/www/js/title.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["jquery", "sammy"], factory);
} else {
(window.Sammy = window.Sammy || {}).Title = factory(
window.jQuery,
window.Sammy,
);
}
})(function ($, Sammy) {
// Sammy.Title is a very simple plugin to easily set the document's title.
// It supplies a helper for setting the title (`title()`) within routes,
// and an app level method for setting the global title (`setTitle()`)
Sammy.Title = function () {
// setTitle allows setting a global title or a function that modifies the
// title for each route/page.
//
// ### Example
//
// // setting a title prefix
// $.sammy(function() {
//
// this.setTitle('My App -');
//
// this.get('#/', function() {
// this.title('Home'); // document's title == "My App - Home"
// });
// });
//
// // setting a title with a function
// $.sammy(function() {
//
// this.setTitle(function(title) {
// return [title, " /// My App"].join('');
// });
//
// this.get('#/', function() {
// this.title('Home'); // document's title == "Home /// My App";
// });
// });
//
this.setTitle = function (title) {
if (!$.isFunction(title)) {
this.title_function = function (additional_title) {
return [title, additional_title].join(" ");
};
} else {
this.title_function = title;
}
};

// *Helper* title() sets the document title, passing it through the function
// defined by setTitle() if set.
this.helper("title", function () {
var new_title = $.makeArray(arguments).join(" ");
if (this.app.title_function) {
new_title = this.app.title_function(new_title);
}
document.title = new_title;
});
};

return Sammy.Title;
});