diff --git a/guacamole/src/main/webapp/app/client/clientModule.js b/guacamole/src/main/webapp/app/client/clientModule.js index 19efc3ff9..dec05e580 100644 --- a/guacamole/src/main/webapp/app/client/clientModule.js +++ b/guacamole/src/main/webapp/app/client/clientModule.js @@ -23,4 +23,4 @@ /** * The module for code used to connect to a connection or balancing group. */ -angular.module('client', ['auth']); +angular.module('client', ['auth', 'history']); diff --git a/guacamole/src/main/webapp/app/history/historyModule.js b/guacamole/src/main/webapp/app/history/historyModule.js new file mode 100644 index 000000000..c81af8d8f --- /dev/null +++ b/guacamole/src/main/webapp/app/history/historyModule.js @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2014 Glyptodon LLC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * The module for code relating to connection history. + */ +angular.module('history', []); diff --git a/guacamole/src/main/webapp/app/home/services/guacHistory.js b/guacamole/src/main/webapp/app/history/services/guacHistory.js similarity index 82% rename from guacamole/src/main/webapp/app/home/services/guacHistory.js rename to guacamole/src/main/webapp/app/history/services/guacHistory.js index efe862eed..c10a0cb65 100644 --- a/guacamole/src/main/webapp/app/home/services/guacHistory.js +++ b/guacamole/src/main/webapp/app/history/services/guacHistory.js @@ -21,9 +21,9 @@ */ /** - * A service for creating Guacamole clients. + * A service for reading and manipulating the Guacamole connection history. */ -angular.module('home').factory('guacHistory', [function guacHistory() { +angular.module('history').factory('guacHistory', ['HistoryEntry', function guacHistory(HistoryEntry) { var service = {}; @@ -36,30 +36,6 @@ angular.module('home').factory('guacHistory', [function guacHistory() { */ var IDEAL_LENGTH = 6; - /** - * A single entry in the connection history. - * - * @constructor - * @param {String} id The ID of the connection. - * - * @param {String} thumbnail - * The URL of the thumbnail to use to represent the connection. - */ - var HistoryEntry = function HistoryEntry(id, thumbnail) { - - /** - * The ID of the connection associated with this history entry. - */ - this.id = id; - - /** - * The thumbnail associated with the connection associated with this - * history entry. - */ - this.thumbnail = thumbnail; - - }; - /** * The top few recent connections, sorted in order of most recent access. * diff --git a/guacamole/src/main/webapp/app/history/types/HistoryEntry.js b/guacamole/src/main/webapp/app/history/types/HistoryEntry.js new file mode 100644 index 000000000..e4bdbe038 --- /dev/null +++ b/guacamole/src/main/webapp/app/history/types/HistoryEntry.js @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2014 Glyptodon LLC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Provides the HistoryEntry class used by the guacHistory service. + */ +angular.module('history').factory('HistoryEntry', [function defineHistoryEntry() { + + /** + * A single entry in the connection history. + * + * @constructor + * @param {String} id The ID of the connection. + * + * @param {String} thumbnail + * The URL of the thumbnail to use to represent the connection. + */ + var HistoryEntry = function HistoryEntry(id, thumbnail) { + + /** + * The ID of the connection associated with this history entry. + */ + this.id = id; + + /** + * The thumbnail associated with the connection associated with this + * history entry. + */ + this.thumbnail = thumbnail; + + }; + + return HistoryEntry; + +}]); diff --git a/guacamole/src/main/webapp/app/home/homeModule.js b/guacamole/src/main/webapp/app/home/homeModule.js index cbe17b62e..4f7d143a3 100644 --- a/guacamole/src/main/webapp/app/home/homeModule.js +++ b/guacamole/src/main/webapp/app/home/homeModule.js @@ -20,4 +20,4 @@ * THE SOFTWARE. */ -angular.module('home', ['connection', 'connectionGroup', 'user', 'permission']); +angular.module('home', ['connection', 'connectionGroup', 'history', 'user', 'permission']);