Skip to content

Commit

Permalink
user can copy selected method
Browse files Browse the repository at this point in the history
  • Loading branch information
giatro committed Feb 11, 2014
1 parent 3870c5d commit f364cdf
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
6 changes: 6 additions & 0 deletions dev/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
$scope.joyride = function(){
jQuery(document).foundation('joyride', 'start');
}
$scope.copyMethod = function() {
document.getElementById('clip').focus();
document.execCommand('selectAll',false,null);
document.execCommand('copy', false, null);
// document.getElementById('clip').blur();
}
$scope.loadServers = function () {
var servers = JSON.parse(localStorage.getItem('servers')) || {};
$scope.server = undefined;
Expand Down
19 changes: 14 additions & 5 deletions dev/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<link rel="stylesheet" href="css/app.css">
</head>
<body ng-controller="AppCtrl" ng-init="init()">
<input type="text" id="clip" ng-model="method" style="position:absolute;top:-10000em;">
<nav class="top-bar row collapse" data-topbar="">
<ul class="title-area"><li class="name"><h1><a><img src="img/logo.svg" alt="" id="logo" /> XML-RPC Client</a></h1></li></ul>
<section class="top-bar-section">
Expand All @@ -36,7 +37,7 @@
</div>
</div>
<div class="row collapse">
<div class="small-6 medium-6 large-8 columns">
<div class="small-7 medium-7 large-7 columns">
<label>Methods</label>
<select id="method" ng-model="method" ng-options="method for method in methods" ng-disabled="methods === undefined || methods.length === 0">
</select>
Expand All @@ -45,13 +46,17 @@
<label>&nbsp;</label>
<button id="loadmethods" type="button" class="button postfix" ng-click="loadMethods()" ng-disabled="server === undefined || server.url === undefined || server.url === ''">Get methods</button>
</div>
<div class="small-2 medium-2 large-1 columns">
<div class="small-1 medium-1 large-1 columns">
<label>&nbsp;</label>
<button id="methodhelp" type="button" class="button secondary postfix" ng-click="methodHelp()" ng-disabled="method === undefined">Help</button>
<button id="copymethod" data-tooltip title="copiy selected method to clipboard" type="button" class="tip-top button secondary postfix" ng-click="copyMethod()" ng-disabled="method === undefined || method === ''"><i class="fa fa-copy"></i></button>
</div>
<div class="small-2 medium-2 large-1 columns">
<div class="small-1 medium-1 large-1 columns">
<label>&nbsp;</label>
<button id="methodsignature" type="button" class="button secondary postfix" ng-click="methodSignature()" ng-disabled="method === undefined">Signature</button>
<button id="methodhelp" data-tooltip title="get selected method's help message" type="button" class="button secondary postfix" ng-click="methodHelp()" ng-disabled="method === undefined"><i class="fa fa-question"></i></button>
</div>
<div class="small-1 medium-1 large-1 columns">
<label>&nbsp;</label>
<button id="methodsignature" data-tooltip title="get selected method's signature" type="button" class="button secondary postfix" ng-click="methodSignature()" ng-disabled="method === undefined"><i class="fa fa-info"></i></button>
</div>
</div>
<div class="row collapse">
Expand Down Expand Up @@ -87,6 +92,10 @@ <h4>History</h4>
<h4>List methods</h4>
<p>List all available XML–RPC methods.</p>
</li>
<li data-id="copymethod" data-button="Next" data-options="tip_location:top">
<h4>Method copy</h4>
<p>Copy selected method to clipboard.</p>
</li>
<li data-id="methodhelp" data-button="Next" data-options="tip_location:top">
<h4>Method help</h4>
<p>Display help message for the selected XML–RPC method.</p>
Expand Down
3 changes: 2 additions & 1 deletion dev/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "XML-RPC Client",
"description": "XML-RPC Client",
"version": "1.0.3",
"version": "1.1.0",
"manifest_version": 2,
"browser_action" : {
"default_icon": "img/ico32.png"
Expand All @@ -16,6 +16,7 @@
"16": "img/ico16.png"
},
"permissions": [
"clipboardWrite",
"storage",
"\u003Call_urls\u003E"
]
Expand Down

0 comments on commit f364cdf

Please sign in to comment.