diff --git a/module/javascript/app/vmap/tools/urlexporter.js b/module/javascript/app/vmap/tools/urlexporter.js index 09d3ac862dd74b2f5a53ed774ca085333fb430d8..d89684f26f381a40125ee0d52a88f24eaa559637 100644 --- a/module/javascript/app/vmap/tools/urlexporter.js +++ b/module/javascript/app/vmap/tools/urlexporter.js @@ -125,6 +125,27 @@ nsVmap.nsToolsManager.Urlexporter.prototype.urlExporterController.prototype.urlC this["urlToExport"] = sUrl; }; + +/** + * Copy the generated URL on the clipboard + * + * @export + */ +nsVmap.nsToolsManager.Urlexporter.prototype.urlExporterController.prototype.copyUrl = function () { + oVmap.log("nsVmap.nsToolsManager.Urlexporter.urlExporterController.copyUrl"); + + /* Get the text field */ + var copyText = document.getElementById("urlExporterField"); + + /* Select the text field */ + copyText.select(); + + /* Copy the text inside the text field */ + document.execCommand("copy"); + + $.notify('Copié', 'success'); +} + // Définit la directive et le controller oVmap.module.directive('appUrlExporter', nsVmap.nsToolsManager.Urlexporter.prototype.urlExporterDirective); oVmap.module.controller('AppUrlExporterController', nsVmap.nsToolsManager.Urlexporter.prototype.urlExporterController); diff --git a/module/template/tools/basictools.html b/module/template/tools/basictools.html index c469aad7af3d5e8c9c1693e78c5ccb976f019b19..0321871288835fc992af7d5daaf74aba86e102d4 100644 --- a/module/template/tools/basictools.html +++ b/module/template/tools/basictools.html @@ -8,9 +8,9 @@ <div> <li role="presentation" style="position: inherit" class="basic-tools-dropdown"> <a class="basic-tools-element pointer" - title="Générateur d'URL" + title="Lien vers la carte en cours" onclick="oVmap.getToolsManager().getBasicTools().toggleTool(this)"> - <span class="icon-at" aria-hidden="true"></span> + <span class="fa fa-link" aria-hidden="true"></span> </a> <div app-url-exporter app-lang="ctrl.lang" app-map="ctrl.map" id="basic-tools-dropdown-urlexporter" diff --git a/module/template/tools/urlexporter.html b/module/template/tools/urlexporter.html index 8219c05115135bb301def37dcd88452878d5a06b..c10845a6e2310f0b48ee40f6479e40e21372608f 100644 --- a/module/template/tools/urlexporter.html +++ b/module/template/tools/urlexporter.html @@ -1,11 +1,30 @@ <!--UrlExporter--> <div class="row margin-sides-0 margin-10"> - <div class="col-md-3" ng-show="ctrl.properties.allow_public_connection"> - <input type="checkbox" ng-model="ctrl.usePublicToken" id="publicAccountCheckbox"> - <label for="publicAccountCheckbox" class="control-label">Public</label> - </div> - <div class="" ng-class="{'col-md-9' : ctrl.properties.allow_public_connection, 'col-md-12': !ctrl.properties.allow_public_connection}"> - <label for="urlExporterField" class="control-label">URL</label> - <input type="text" class="form-control" ng-model="ctrl.urlToExport" id="urlExporterField"> + <div class="col-md-12"> + <div class="left"> + <label for="urlExporterField" class="control-label">Lien vers la carte en cours</label> + </div> + <div class="right" ng-if="ctrl.properties.allow_public_connection"> + <div class="checkbox checkbox-info checkbox-inline"> + <input id="publicAccountCheckbox" + type="checkbox" + style="cursor:pointer;" + title=">Activer / Désactiver le mode public" + ng-model="ctrl.usePublicToken"> + <label for="publicAccountCheckbox" + style="cursor:pointer" + title="Activer / Désactiver le mode public"> + Public + </label> + </div> + </div> </div> -</div> \ No newline at end of file + <div class="col-md-12"> + <div class="input-group"> + <input type="text" class="form-control" ng-model="ctrl.urlToExport" id="urlExporterField"> + <span class="input-group-btn"> + <button type="button" class="btn btn-default" ng-click="ctrl.copyUrl()"><span class="icon-copy"></span></button> + </span> + </div> + </div> +</div>