Skip to content
This repository
Browse code

deployment connections!

  • Loading branch information...
commit e8667becb1788a6c5f9696e229911d279a0c1628 2 parents 35f1bf8 + 05b112b
Joe Ferraro authored
6 Default.sublime-commands
@@ -44,7 +44,11 @@
44 44 "command": "new_apex_component"
45 45 },
46 46 {
47   - "caption": "Deploy To Server",
  47 + "caption": "MavensMate: Deploy To Server",
48 48 "command": "deploy_to_server"
  49 + },
  50 + {
  51 + "caption": "MavensMate: Deployment Connections",
  52 + "command": "org_connections"
49 53 }
50 54 ]
4 Main.sublime-menu
@@ -28,6 +28,10 @@
28 28 {
29 29 "caption": "Compile Project",
30 30 "command": "compile_project"
  31 + },
  32 + {
  33 + "caption": "Deployment Connections",
  34 + "command": "org_connections"
31 35 }
32 36 ]
33 37 },
2  commands/deployment_connections.rb
@@ -4,4 +4,4 @@
4 4 require SUPPORT + "/environment.rb"
5 5 require CONTROLLERS_ROOT + "/org_connection_controller.rb"
6 6 ENV["MM_CURRENT_PROJECT_DIRECTORY"] = ARGV[0]
7   -dispatch :controller => "project", :action => "index_new", :user_action => "checkout"
  7 +dispatch :controller => "org_connection", :action => "index"
10 mavensmate.py
@@ -116,6 +116,14 @@ def run (self):
116 116 #mark_lines(self, None)
117 117 clear_marked_lines()
118 118
  119 +#launches the org connections UI
  120 +class OrgConnectionsCommand(sublime_plugin.ApplicationCommand):
  121 + def run(command):
  122 + start_local_server()
  123 + temp_file_name = generate_ui("deployment_connections", "'"+mm_project_directory()+"'")
  124 + launch_mavens_mate_window(temp_file_name)
  125 +
  126 +
119 127 #takes user to the update directions on github (should be unnecessary once package control support is finalized)
120 128 class UpdateMeCommand(sublime_plugin.ApplicationCommand):
121 129 def run(self):
@@ -665,7 +673,7 @@ def on_post_save(self, view):
665 673 settings = sublime.load_settings('mavensmate.sublime-settings')
666 674 active_file = get_active_file()
667 675 fileName, ext = os.path.splitext(active_file)
668   - valid_file_extensions = ['.page', '.component', '.cls', '.object', '.page', '.trigger', '.tab', '.layout', '.resource', '.remoteSite']
  676 + valid_file_extensions = ['.page', '.component', '.cls', '.object', '.page', '.trigger', '.tab', '.layout', '.resource', '.remoteSite', '.labels', '.app', '.dashboard']
669 677 if settings.get('mm_compile_on_save') == True and is_mm_project() == True and ext in valid_file_extensions:
670 678 printer = PanelPrinter.get(view.window().id())
671 679 printer.show()
3  support/app/controllers/deploy_controller.rb
@@ -21,7 +21,8 @@ def index
21 21 connections.push({
22 22 :un => connection["username"],
23 23 :pw => pw,
24   - :server_url => server_url
  24 + :server_url => server_url,
  25 + :type => connection["environment"]
25 26 })
26 27 end
27 28 rescue Exception => e
6 support/app/controllers/org_connection_controller.rb
@@ -17,9 +17,9 @@ def index
17 17 #adds a new deployment connection to a project, stores creds in keychain
18 18 def new_connection
19 19 begin
20   - un = params[:un]
21   - pw = params[:pw]
22   - server_url = params[:server_url]
  20 + un = params[:un].to_s
  21 + pw = params[:pw].to_s
  22 + server_url = params[:server_url].to_s
23 23
24 24 TextMate.call_with_progress( :title => "MavensMate", :message => "Validating Salesforce.com Credentials" ) do
25 25 client = MavensMate::Client.new({ :username => params[:un], :password => params[:pw], :endpoint => params[:server_url] })
461 support/app/views/deploy/_deploy.html.erb
... ... @@ -1,13 +1,13 @@
1 1 <style>
2   - .bordered-table, .bordered-table td {
3   - -webkit-border-radius: 0px !important;
4   - border-radius: 0px !important;
5   - }
6   -
7   - .bordered-table {
8   - border-bottom:2px solid #ccc !important;
9   - }
10   -
  2 +.bordered-table, .bordered-table td {
  3 + -webkit-border-radius: 0px !important;
  4 + border-radius: 0px !important;
  5 +}
  6 +
  7 +.bordered-table {
  8 + border-bottom:2px solid #ccc !important;
  9 +}
  10 +
11 11 </style>
12 12 <div id="result_output">
13 13
@@ -31,6 +31,7 @@
31 31 <li class="active"><a href="#form">Deploy Options</a></li>
32 32 <li><a href="#metadata">Metadata</a></li>
33 33 <li><a href="#result" id="result_tab">Result</a></li>
  34 + <li><a href="#arcade" id="arcade_tab">Arcade</a></li>
34 35 </ul>
35 36
36 37 <div class="pill-content">
@@ -40,7 +41,7 @@
40 41 <div class="clearfix">
41 42 <label for="un">Deployment Targets</label>
42 43 <%
43   - display = connections.size == 0 ? "block" : "none"
  44 + display = connections.size == 0 ? "block" : "none"
44 45 %>
45 46
46 47 <% if connections.size > 0 %>
@@ -102,27 +103,27 @@
102 103 </div> -->
103 104 <!-- <div id="deploy_info" style="display:none;" class="alert-message block-message info">
104 105 <p><strong>This deployment will run in async mode.</strong></p>
105   - </div> -->
106   -
107   - </fieldset>
  106 + </div> -->
  107 +
  108 + </fieldset>
108 109 </form>
109 110 </div>
110 111
111 112
112 113 <style>
113   - #filter {
114   - background-color:#f7f7f7;
115   - padding:5px;
116   - border-bottom:1px solid #ccc;
117   - margin-bottom:10px;
118   - position:relative;
119   - }
  114 + #filter {
  115 + background-color:#f7f7f7;
  116 + padding:5px;
  117 + border-bottom:1px solid #ccc;
  118 + margin-bottom:10px;
  119 + position:relative;
  120 + }
120 121 </style>
121   -
  122 +
122 123 <div id="metadata">
123 124
124 125 <form class="form-stacked" style="padding-left:5px;margin-bottom:2px;">
125   - <fieldset>
  126 + <fieldset>
126 127 <!-- <div class="clearfix">
127 128 <label for="ptype">Package Type</label>
128 129 <select id="ptype">
@@ -135,7 +136,7 @@
135 136 <label for="cset">Changeset</label>
136 137 <select id="cset">
137 138 <% changesets.each do |c| %>
138   - <option><%= c %></option>
  139 + <option><%= c %></option>
139 140 <% end %>
140 141 </select>
141 142 </div>
@@ -143,15 +144,15 @@
143 144 </form>
144 145
145 146 <script>
146   - $("#ptype").change(function() {
147   - if (this.value == "Custom") {
148   - $("#project_wrapper").show();
149   - $("#changesetwrapper").hide();
150   - } else {
151   - $("#project_wrapper").hide();
152   - $("#changesetwrapper").show();
153   - }
154   - })
  147 + $("#ptype").change(function() {
  148 + if (this.value == "Custom") {
  149 + $("#project_wrapper").show();
  150 + $("#changesetwrapper").hide();
  151 + } else {
  152 + $("#project_wrapper").hide();
  153 + $("#changesetwrapper").show();
  154 + }
  155 + })
155 156 </script>
156 157
157 158 <div id="project_wrapper">
@@ -160,13 +161,13 @@
160 161 <input type="text" id="txtFilter" style="width:165px" />
161 162 <a href="#" id="btnClearFilter" onclick="clearFilter();" class="btn small error" style="visibility:invisible;opacity:0;font-weight:bold;position:relative;top:1px;right:30px;padding:4px 7px 4px;">X</a>
162 163 <a href="#" id="btnSelectAll" class="btn small" style="font-weight:normal;padding:4px 7px 4px;">all</a>
163   - <a href="#" id="btnDeselectAll" class="btn small" style="font-weight:normal;padding:4px 7px 4px;">none</a>
  164 + <a href="#" id="btnDeselectAll" class="btn small" style="font-weight:normal;padding:4px 7px 4px;">none</a>
164 165 </div>
165 166
166 167 <div id="treewrapper">
167 168 <div id="tree">
168 169 <ul>
169   -
  170 +
170 171 </ul>
171 172 </div>
172 173 <div id="info"></div>
@@ -174,6 +175,25 @@
174 175 </div>
175 176 </div>
176 177
  178 + <div class="content" id="arcade">
  179 + <ul class="tabs tabs-below">
  180 + <li class="game"><a href="#game_pacman">Pacman</a></li>
  181 + <li class="game"><a href="#game_tetris">Tetris</a></li>
  182 + <li class="game"><a href="#game_donkey">Donkey Kong</a></li>
  183 + </ul>
  184 + <div class="pill-content">
  185 + <div class="active" id="game_pacman">
  186 + <embed src="http://www.classicgamesarcade.com/games/pacman.swf" width="100%" height="75%" autostart="true" loop="false" controller="true" id="pacman" class="flash_game"></embed>
  187 + </div>
  188 + <div id="game_tetris">
  189 + <embed src="http://www.classicgamesarcade.com/games/flash-tetris.swf" width="100%" height="75%" autostart="true" loop="false" controller="true" id="tetris" class="flash_game"></embed>
  190 + </div>
  191 + <div id="game_donkey">
  192 + <embed src="http://www.classicgamesarcade.com/games/donkeykong.swf" width="100%" height="75%" autostart="true" loop="false" controller="true" id="donkey" class="flash_game"></embed>
  193 + </div>
  194 + </div>
  195 + </div>
  196 +
177 197 <div id="result">
178 198
179 199 </div>
@@ -182,89 +202,71 @@
182 202
183 203
184 204 <form class="form-stacked" id="action_buttons">
185   - <fieldset style="padding-top:0px;">
  205 + <fieldset style="padding-top:0px;position:relative;">
186 206 <div class="actions">
187 207 <input id="btnDeploy" type="button" class="btn primary" value="Deploy to Server" onclick='deploy()'>
188 208 &nbsp;
189 209 <button type="reset" class="btn" onclick="window.close();">Cancel</button>
190 210 </div>
  211 + <img src="<%=ENV['TM_BUNDLE_SUPPORT']%>/resource/images/big_loading.gif" style="position:absolute;top:13px;right:25px;width:36px;display:none;" id="deployment_indicator"/>
191 212 </fieldset>
192 213 </form>
193 214
194 215 <script type="text/javascript">
195   - var mm_cpd = '<%= ENV["MM_CURRENT_PROJECT_DIRECTORY"] %>';
196   - var has_indexed_metadata = <%= File.exist? "#{ENV["MM_CURRENT_PROJECT_DIRECTORY"]}/config/.org_metadata" %>;
  216 +var mm_cpd = '<%= ENV["MM_CURRENT_PROJECT_DIRECTORY"] %>';
  217 +var has_indexed_metadata = <%= File.exist? "#{ENV["MM_CURRENT_PROJECT_DIRECTORY"]}/config/.org_metadata" %>;
197 218
198   - document.title = "Deploy To Server";
199   -
200   - var child_def = {}
201   - <%- child_metadata_definition.each do |child| -%>
202   - child_def['<%= child[:tag_name] %>'] = '<%= child[:xml_name] %>';
203   - <%- end -%>
204   -
205   - var pw_def = {}
206   - <%- connections.each do |c| -%>
207   - pw_def['<%= c[:un] %>'] = '<%= c[:pw] %>';
208   - <%- end -%>
209   -
210   - var surl_def = {}
211   - <%- connections.each do |c| -%>
212   - surl_def['<%= c[:un] %>'] = '<%= c[:server_url] %>';
213   - <%- end -%>
214   -
215   - function isValidateOnly() {
216   - if ($("#check_only").is(":checked")) {
217   - return "1";
218   - } else {
219   - return "0";
220   - }
  219 +document.title = "Deploy To Server";
  220 +
  221 +var child_def = {}
  222 +<%- child_metadata_definition.each do |child| -%>
  223 +child_def['<%= child[:tag_name] %>'] = '<%= child[:xml_name] %>';
  224 +<%- end -%>
  225 +
  226 +var pw_def = {}
  227 +<%- connections.each do |c| -%>
  228 +pw_def['<%= c[:un] %>'] = '<%= c[:pw] %>';
  229 +<%- end -%>
  230 +
  231 +var surl_def = {}
  232 +<%- connections.each do |c| -%>
  233 +surl_def['<%= c[:un] %>'] = '<%= c[:server_url] %>';
  234 +<%- end -%>
  235 +
  236 +function isValidateOnly() {
  237 + if ($("#check_only").is(":checked")) {
  238 + return "1";
  239 + } else {
  240 + return "0";
221 241 }
222   -
223   - function deployMode() {
224   - if ($("#set_and_forget").is(":checked")) {
225   - return "async";
226   - } else {
227   - return "";
228   - }
  242 +}
  243 +
  244 +function deployMode() {
  245 + if ($("#set_and_forget").is(":checked")) {
  246 + return "async";
  247 + } else {
  248 + return "";
229 249 }
230   -
231   - $("#save_changeset").click(function() {
232   - if (this.checked) {
233   - $("#changeset_name_wrapper").show();
234   - } else {
235   - $("#changeset_name_wrapper").hide();
236   - }
237   - });
238   -
239   - function resizeWindowAfterResult() {
240   - window.resizeTo(800, window.innerHeight);
241   - window.moveTo(
242   - (screen.width-800)/2,
243   - (screen.height-document.getElementById('wrapper').offsetHeight-400)/2
244   - );
  250 +}
  251 +
  252 +$("#save_changeset").click(function() {
  253 + if (this.checked) {
  254 + $("#changeset_name_wrapper").show();
  255 + } else {
  256 + $("#changeset_name_wrapper").hide();
245 257 }
  258 +});
246 259
247   - $(function() {
248   -
249   - //if dom elements is removed, we need to resize the window
250   - $( "body" ).bind(
251   - "DOMNodeInserted",
252   - function( event ) {
253   - if (event.target.id == "result") {
254   - $("#result_tab").click();
255   - $(".result_table_class").height($(window).height() - 300)
256   - $(window).resize(function() {
257   - $(".result_table_class").height($(window).height() - 300)
258   - });
259   - resizeWindowAfterResult();
260   - }
261   - }
262   - );
263   -
264   - // $("#un").val($("#un_list").val());
265   - // $("#pw").val(pw_def[this.value]);
266   - // $("#server_url").val(surl_def[this.value]);
267   -
  260 +function resizeWindowAfterResult() {
  261 + window.resizeTo(800, window.innerHeight);
  262 + window.moveTo(
  263 + (screen.width-800)/2,
  264 + (screen.height-document.getElementById('wrapper').offsetHeight-400)/2
  265 + );
  266 +}
  267 +
  268 +$(function() {
  269 +
268 270 $("#check_only").change(function() {
269 271 if (!this.checked) {
270 272 $("#btnDeploy").val('Deploy to Server');
@@ -291,26 +293,27 @@
291 293 $("#un").val($("#un_list").val());
292 294 $("#pw").val(pw_def[$("#un_list").val()]);
293 295 }
294   -
  296 +
295 297 $('.tabs').tabs();
296 298
297   - $("#project_wrapper").height($(window).height() - 225)
  299 + $("#project_wrapper").height($(window).height() - 225)
298 300
299   - var resizeHeight = $("#form").height();
300   - resizeAndCenterWindowByHeight(resizeHeight + 250);
  301 + var resizeHeight = $("#form").height();
  302 + resizeAndCenterWindowByHeight(resizeHeight + 250);
301 303
302   - $(window).resize(function() {
303   - $("#project_wrapper").height($(window).height() - 225)
304   - });
  304 + $(window).resize(function() {
  305 + $("#project_wrapper").height($(window).height() - 225)
  306 + resize_games()
  307 + });
305 308
306 309
307   - $.expr[':'].Contains = function(a, i, m) {
308   - return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase()) >= 0;
309   - };
  310 + $.expr[':'].Contains = function(a, i, m) {
  311 + return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase()) >= 0;
  312 + };
310 313
311   - $("#txtFilter")
312   - .change(function() {
313   - var filter = $(this).val();
  314 + $("#txtFilter")
  315 + .change(function() {
  316 + var filter = $(this).val();
314 317 //if (filter.length < 3) return false;
315 318 // if (filter) {
316 319 // // this finds all links in a list that contain the input,
@@ -324,19 +327,19 @@
324 327 // } else {
325 328 // $(".dynatree-node").parent().show();
326 329 // }
327   - if (filter) {
328   - $("#btnClearFilter").css({opacity: 1.0, visibility: "visible"})
329   - expandAll();
330   - filter_tree(filter);
331   - } else {
332   - $("#btnClearFilter").css({opacity: 0.0, visibility: "invisible"})
333   - clearFilter();
334   - }
  330 + if (filter) {
  331 + $("#btnClearFilter").css({opacity: 1.0, visibility: "visible"})
  332 + expandAll();
  333 + filter_tree(filter);
  334 + } else {
  335 + $("#btnClearFilter").css({opacity: 0.0, visibility: "invisible"})
  336 + clearFilter();
  337 + }
335 338 return false;
336 339 })
337   - .keyup(function() {
  340 +.keyup(function() {
338 341 // fire the above change event after every letter
339   - $(this).change();
  342 + $(this).change();
340 343 });
341 344
342 345 index_org(!has_indexed_metadata);
@@ -344,105 +347,101 @@
344 347 $("#un_list").chosen();
345 348 });
346 349
347   - function filter_tree(searchTerm) {
348   - var regex = new RegExp(searchTerm,"i");
349   - rootNode.visit(function(node) {
350   - if (node.isVisible() && node.data.title) {
351   - nodeTitle = node.data.title;
352   - if ( nodeTitle.match(regex) ) {
353   - node.visitParents(function(node) {
354   - $(node.li).show();
355   - return (node.parent != null);
356   - }, true);
357   - return 'skip';
358   - } else {
359   - $(node.li).hide();
360   - }
  350 +function filter_tree(searchTerm) {
  351 + var regex = new RegExp(searchTerm,"i");
  352 + rootNode.visit(function(node) {
  353 + if (node.isVisible() && node.data.title) {
  354 + nodeTitle = node.data.title;
  355 + if ( nodeTitle.match(regex) ) {
  356 + node.visitParents(function(node) {
  357 + $(node.li).show();
  358 + return (node.parent != null);
  359 + }, true);
  360 + return 'skip';
  361 + } else {
  362 + $(node.li).hide();
361 363 }
362   - });
363   - }
364   -
365   - function expandAll() {
366   - $("#tree").dynatree("getRoot").visit(function(node){
367   - node.expand(true);
368   - });
369   - }
370   -
371   - function collapseAll() {
372   - $("#tree").dynatree("getRoot").visit(function(node){
373   - node.expand(false);
374   - });
375   - }
376   -
377   - function clearFilter() {
378   - $('#txtFilter').val('');
379   - $("#btnClearFilter").css({opacity: 0.0, visibility: "visible"});
380   - collapseAll();
381   - $(".dynatree-container li").show();
382   - $('#txtFilter').focus();
383   - }
384   -
385   - $("#btnDeselectAll").click(function(){
386   - $("#tree").dynatree("getRoot").visit(function(node){
387   - if ($(node.li).css('display') != 'none') {
388   - try {
389   - if (node.data.level > 1)
390   - node.select(false);
391   - } catch(e) {
392   - node.select(false);
393   - }
  364 + }
  365 + });
  366 +}
  367 +
  368 +function expandAll() {
  369 + $("#tree").dynatree("getRoot").visit(function(node){
  370 + node.expand(true);
  371 + });
  372 +}
  373 +
  374 +function collapseAll() {
  375 + $("#tree").dynatree("getRoot").visit(function(node){
  376 + node.expand(false);
  377 + });
  378 +}
  379 +
  380 +function clearFilter() {
  381 + $('#txtFilter').val('');
  382 + $("#btnClearFilter").css({opacity: 0.0, visibility: "visible"});
  383 + collapseAll();
  384 + $(".dynatree-container li").show();
  385 + $('#txtFilter').focus();
  386 +}
  387 +
  388 +$("#btnDeselectAll").click(function(){
  389 + $("#tree").dynatree("getRoot").visit(function(node){
  390 + if ($(node.li).css('display') != 'none') {
  391 + try {
  392 + if (node.data.level > 1)
  393 + node.select(false);
  394 + } catch(e) {
  395 + node.select(false);
394 396 }
395   - });
396   - return false;
  397 + }
397 398 });
398   - $("#btnSelectAll").click(function(){
399   - $("#tree").dynatree("getRoot").visit(function(node){
400   - if ($(node.li).css('display') != 'none') {
401   - try {
402   - if (node.data.level > 1)
403   - node.select(true);
404   - } catch(e) {
405   - node.select(true);
406   - }
407   - }
408   - });
409   - return false;
  399 + return false;
  400 +});
  401 +$("#btnSelectAll").click(function(){
  402 + $("#tree").dynatree("getRoot").visit(function(node){
  403 + if ($(node.li).css('display') != 'none') {
  404 + try {
  405 + if (node.data.level > 1)
  406 + node.select(true);
  407 + } catch(e) {
  408 + node.select(true);
  409 + }
  410 + }
410 411 });
  412 + return false;
  413 +});
411 414
412   - var rootNode;
413   -
414   - function index_org(refresh) {
415   - console.log('indexing org')
416   - console.log(refresh)
417   - $.ajax({
418   - type: "GET",
419   - url: "http://127.0.0.1:7777/metadata/index",
420   - data: {
421   - mm_current_project_directory: mm_cpd,
422   - do_refresh: refresh
423   - },
424   - beforeSend: function() { showLoading('Indexing your Salesforce.com metatada. This operation could take a while depending on the size of your org. Thanks for being patient! :)'); },
425   - complete: function(data){
426   - console.log(data)
427   - $("#tree").dynatree("destroy")
428   - $("#tree ul").html(data.responseText);
429   - $("#tree").dynatree({
430   - persist: false,
431   - checkbox: true,
432   - selectMode: 3
433   - });
434   - $("#tree").dynatree("getRoot").visit(function(node) {
435   - node.expand(false);
436   - });
437   - rootNode = $("#tree").dynatree("getRoot");
438   - hideLoading();
439   - }
440   - });
441   - }
  415 +var rootNode;
442 416
443   - function refresh_index() {
444   - index_org(true);
445   - }
  417 +function index_org(refresh) {
  418 + console.log('indexing org')
  419 + console.log(refresh)
  420 + $.ajax({
  421 + type: "GET",
  422 + url: "http://127.0.0.1:7777/metadata/index",
  423 + data: {
  424 + mm_current_project_directory: mm_cpd,
  425 + do_refresh: refresh
  426 + },
  427 + beforeSend: function() { showLoading('Indexing your Salesforce.com metatada. This operation could take a while depending on the size of your org. Thanks for being patient! :)'); },
  428 + complete: function(data){
  429 + console.log(data)
  430 + $("#tree").dynatree("destroy")
  431 + $("#tree ul").html(data.responseText);
  432 + $("#tree").dynatree({
  433 + persist: false,
  434 + checkbox: true,
  435 + selectMode: 3
  436 + });
  437 + $("#tree").dynatree("getRoot").visit(function(node) {
  438 + node.expand(false);
  439 + });
  440 + rootNode = $("#tree").dynatree("getRoot");
  441 + hideLoading();
  442 + }
  443 + });
  444 +}
446 445
447 446 function get_target_json() {
448 447 var targets = $("#un_list").val();
@@ -470,12 +469,30 @@
470 469 tree: get_tree(),
471 470 mm_current_project_directory: mm_cpd
472 471 },
473   - beforeSend: function() { showLoading('Deploying to Salesforce.com'); },
  472 + beforeSend: function() { showElement("deployment_indicator"); $("#btnDeploy").hide() },
474 473 complete: function(data){
475 474 console.log(data)
476 475 $("#result").html(data.responseText);
477   - hideLoading();
  476 +
  477 + hideElement("deployment_indicator");
  478 + $("#btnDeploy").show();
  479 +
  480 + $(".result_table_class").height($(window).height() - 300)
  481 + $(window).resize(function() {
  482 + $(".result_table_class").height($(window).height() - 300)
  483 + });
  484 +
  485 + if ($("#arcade").css("display") == "none") {
  486 + $("#result_tab").click();
  487 + resizeWindowAfterResult();
  488 + }
478 489 }
479 490 });
480   - }
  491 + }
  492 +
  493 +function refresh_index() {
  494 + index_org(true);
  495 +}
  496 +
  497 +
481 498 </script>
6 support/app/views/deploy/_deploy_result.html.erb
... ... @@ -1,4 +1,4 @@
1   -<div id="result" style="padding:10px;">
  1 +<div class="result_wrapper" style="padding:10px;">
2 2 <% if result[:is_success] %>
3 3 <div class="alert-message success">
4 4 <% deploy_type = (is_check_only == "1") ? "validation" : "deployment" %>
@@ -12,11 +12,11 @@
12 12 <% end %>
13 13 <% if ! result[:is_success] %>
14 14 <div id="error_message" class="alert-message error">
15   - <p><strong>Deployment Failed!</strong></p>
  15 + <p><strong>Deployment Failed!</strong>&nbsp;</p>
16 16 </div>
17 17 <% end %>
18 18
19   - <div id="result_table_wrapper" style="-webkit-border-radius: 4px 4px 4px 4px;overflow-y:auto;padding:0px;border:2px solid #ccc;">
  19 + <div class="result_table_class" style="-webkit-border-radius: 4px 4px 4px 4px;overflow-y:auto;padding:0px;border:2px solid #ccc;">
20 20
21 21 <% if result[:messages].size > 0 %>
22 22 <div style="padding:5px 10px;background-color:#f2f2f2;border-bottom:2px solid #ccc;cursor:pointer;" onclick="$('#result_table').toggle();">Deploy Messages</div>
21 support/app/views/deploy/_deploy_target_tabs.html.erb
... ... @@ -0,0 +1,21 @@
  1 +<ul class="tabs deploy_wrapper_tabs">
  2 + <% targets.each_with_index do |t, i| %>
  3 + <li class="<%= 'active' if i == 0 %>"><a href="#result-<%= i %>"><%= t[:un] %></a></li>
  4 + <% end %>
  5 +</ul>
  6 +
  7 +<div class="pill-content" id="deploy_result_wrapper">
  8 + <%= deploy_result_html %>
  9 +</div>
  10 +
  11 +<script>
  12 + var i = 0
  13 + $(".result_wrapper").each(function() {
  14 + $(this).attr("id", "result-"+i)
  15 + i++
  16 + })
  17 + $('#deploy_result_wrapper div').first().addClass("active")
  18 + $('.tabs.deploy_wrapper_tabs').tabs()
  19 + // $("#result-1").click();
  20 + // $("#result-0").click();
  21 +</script>
4 support/app/views/layouts/base.html.erb
... ... @@ -1,5 +1,5 @@
1   -<% script_tag = javascript_include_tag("jquery", "jqueryui", "twipsy", "tabs", "toggle", "dynatree2", "alerts", "popover", "tooltips", "mavensmate", "jquery.tablescroll") %>
2   -<% style_tag = style_include_tag("bootstrap", "mavensmate", "dynatree") %>
  1 +<% script_tag = javascript_include_tag("jquery", "jqueryui", "twipsy", "tabs", "toggle", "dynatree2", "alerts", "popover", "tooltips", "mavensmate", "jquery.tablescroll", "chosen.jquery.js") %>
  2 +<% style_tag = style_include_tag("bootstrap", "mavensmate", "dynatree", "chosen") %>
3 3 <html>
4 4 <head>
5 5 <title>MavensMate</title>
30 support/app/views/org_connection/_connections.html.erb
... ... @@ -0,0 +1,30 @@
  1 +<% if connections.size == 0 %>
  2 + <div class="alert-message block-message info">
  3 + <p><strong>A deployment connection is a Salesforce.com org that you wish to deploy to from this MavensMate project.</strong></p>
  4 + </div>
  5 + <div class="alert-message block-message warning">
  6 + <p><strong>You do not have any deployment connections set up </strong></p>
  7 + </div>
  8 +<% else %>
  9 +<div class="alert-message block-message-custom" style="margin-bottom:0px;padding: 5px;-webkit-border-radius: 4px 4px 0px 0px;">
  10 + <p style="float:left;"><strong>Deployment Connections</strong></p>
  11 + <div style="clear:both;"></div>
  12 +</div>
  13 +<table class="bordered-table test_result" style="-webkit-border-radius: 0px 0px 4px 4px;">
  14 + <thead>
  15 + <tr>
  16 + <th>Connection</th>
  17 + <th>Action</th>
  18 + </tr>
  19 + </thead>
  20 + <tbody id="connections_list">
  21 + <% connections.each do |c| %>
  22 + <tr>
  23 + <td><%= c[:un] %></td>
  24 + <td><a href="javascript:void(0);" onclick="deleteConnection('<%= c[:un] %>')">Remove</a></td>
  25 + </tr>
  26 + <% end %>
  27 + </tbody>
  28 +</table>
  29 +
  30 +<% end %>
117 support/app/views/org_connection/_index.html.erb
... ... @@ -1,39 +1,39 @@
1   -<div id="result_output">
2   -
3   -</div>
4   -
5 1 <div class="content">
6   -
7   - <% if connections.size == 0 %>
8   - <div class="alert-message block-message info">
9   - <p><strong>A deployment connection is a Salesforce.com org that you wish to deploy to from this MavensMate project.</strong></p>
10   - </div>
11   - <div class="alert-message block-message warning">
12   - <p><strong>You do not have any deployment connections set up </strong></p>
13   - </div>
14   - <% else %>
15   - <div class="alert-message block-message-custom" style="margin-bottom:0px;padding: 5px;-webkit-border-radius: 4px 4px 0px 0px;">
16   - <p style="float:left;"><strong>Deployment Connections</strong></p>
17   - <div style="clear:both;"></div>
18   - </div>
19   - <table class="bordered-table test_result" style="-webkit-border-radius: 0px 0px 4px 4px;">
20   - <thead>
21   - <tr>
22   - <th>Connection</th>
23   - <th>Action</th>
24   - </tr>
25   - </thead>
26   - <tbody>
27   - <% connections.each do |c| %>
28   - <tr>
29   - <td><%= c[:un] %></td>
30   - <td><a href="javascript:void(0);" onclick="deleteConnection('<%= c[:un] %>')">Remove</a></td>
31   - </tr>
32   - <% end %>
33   - </tbody>
34   - </table>
  2 + <div id="error_wrapper">
35 3
36   - <% end %>
  4 + </div>
  5 + <span id="connections_wrapper">
  6 + <% if connections.size == 0 %>
  7 + <div class="alert-message block-message info">
  8 + <p><strong>A deployment connection is a Salesforce.com org that you wish to deploy to from this MavensMate project.</strong></p>
  9 + </div>
  10 + <div class="alert-message block-message warning">
  11 + <p><strong>You do not have any deployment connections set up </strong></p>
  12 + </div>
  13 + <% else %>
  14 + <div class="alert-message block-message-custom" style="margin-bottom:0px;padding: 5px;-webkit-border-radius: 4px 4px 0px 0px;">
  15 + <p style="float:left;"><strong>Deployment Connections</strong></p>
  16 + <div style="clear:both;"></div>
  17 + </div>
  18 + <table class="bordered-table test_result" style="-webkit-border-radius: 0px 0px 4px 4px;">
  19 + <thead>
  20 + <tr>
  21 + <th>Connection</th>
  22 + <th>Action</th>
  23 + </tr>
  24 + </thead>
  25 + <tbody id="connections_list">
  26 + <% connections.each do |c| %>
  27 + <tr>
  28 + <td><%= c[:un] %></td>
  29 + <td><a href="javascript:void(0);" onclick="deleteConnection('<%= c[:un] %>')">Remove</a></td>
  30 + </tr>
  31 + <% end %>
  32 + </tbody>
  33 + </table>
  34 +
  35 + <% end %>
  36 + </div>
37 37
38 38 <div id="form" class="active">
39 39 <form class="form-stacked">
@@ -51,6 +51,7 @@
51 51 <select id="server_url">
52 52 <option>https://www.salesforce.com</option>
53 53 <option>https://test.salesforce.com</option>
  54 + <option>https://prerellogin.pre.salesforce.com</option>
54 55 </select>
55 56 </div>
56 57 <div class="clearfix" style="margin-top:15px;">
@@ -74,11 +75,55 @@
74 75
75 76 <script type="text/javascript">
76 77 function deleteConnection(username) {
77   - $('body').html(dispatch({controller: 'org_connection', action: 'delete_connection', un: username }));
  78 + $.ajax({
  79 + type: "DELETE",
  80 + url: "http://127.0.0.1:7777/connections",
  81 + data: {
  82 + un: username,
  83 + pd: '<%= ENV['MM_CURRENT_PROJECT_DIRECTORY'] %>'
  84 +
  85 + },
  86 + beforeSend: function() { showLoading('Removing connection'); },
  87 + complete: function(data){
  88 + $("#error_wrapper").html('')
  89 + console.log(data)
  90 + var response = JSON.parse(data.responseText)
  91 + if (response["success"] == false) {
  92 + $("#error_wrapper").html(response["message"])
  93 + } else {
  94 + $("#connections_wrapper").html(response["message"])
  95 + }
  96 + hideLoading()
  97 + }
  98 + });
78 99 }
79 100
80 101 function newConnection() {
81   - $('body').html(dispatch({controller: 'org_connection', action: 'new_connection', un: $('#un').val(), pw: $('#pw').val(), server_url: $('#server_url').val() }));
  102 + $.ajax({
  103 + type: "POST",
  104 + url: "http://127.0.0.1:7777/connections",
  105 + data: {
  106 + un: $("#un").val(),
  107 + pw: $("#pw").val(),
  108 + server_url: $("#server_url").val(),
  109 + pd: '<%= ENV['MM_CURRENT_PROJECT_DIRECTORY'] %>'
  110 +
  111 + },
  112 + beforeSend: function() { showLoading('Adding connection'); },
  113 + complete: function(data){
  114 + $("#error_wrapper").html('')
  115 + console.log(data)
  116 + var response = JSON.parse(data.responseText)
  117 + if (response["success"] == false) {
  118 + $("#error_wrapper").html(response["message"])
  119 + } else {
  120 + $("#un").val('')
  121 + $("#pw").val('')
  122 + $("#connections_wrapper").html(response["message"])
  123 + }
  124 + hideLoading()
  125 + }
  126 + });
82 127 }
83 128
84 129 $(function() {
2  support/app/views/project/_project_new.html.erb
@@ -191,7 +191,7 @@
191 191 where: "<%= ENV['MM_WORKSPACE'] %>",
192 192 action: "checkout"
193 193 },
194   - beforeSend: function() { showLoading('Checking project our from source control'); },
  194 + beforeSend: function() { showLoading('Checking project out from source control'); },
195 195 complete: function(data){
196 196 console.log(data)
197 197 var response = JSON.parse(data.responseText)
418 support/app/views/unit_test/_index.html.erb
@@ -6,7 +6,7 @@
6 6
7 7 <style>
8 8 .results_hidden {
9   - display:none;
  9 + display:none;
10 10 }
11 11 #mm_logger {
12 12 display:none;
@@ -42,7 +42,7 @@ table.code td.covered {
42 42 table.code td.not_covered {
43 43 background: #fdd;
44 44 }
45   -
  45 +
46 46 table.code tr td.line_numbers {
47 47 text-align: right;
48 48 vertical-align: top;
@@ -80,17 +80,17 @@ table.code td {
80 80 /*.container {
81 81 width: 100%;
82 82 margin-left: 12px;
83   -} */
  83 + } */
84 84
85   -h4 {
86   - background: none repeat scroll 0 0 #777777;
87   - border: none;
  85 + h4 {
  86 + background: none repeat scroll 0 0 #777777;
  87 + border: none;
88 88 font-weight:normal;
89   - border-radius: 4px 4px 0 0;
90   - color: #FFFFFF;
91   - margin: 0;
92   - padding: 3px;
93   - text-align: center;
  89 + border-radius: 4px 4px 0 0;
  90 + color: #FFFFFF;
  91 + margin: 0;
  92 + padding: 3px;
  93 + text-align: center;
94 94 line-height:1.3;
95 95
96 96 background-color:#222;background-color:#222222;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#333333), to(#222222));background-image:-moz-linear-gradient(top, #333333, #222222);background-image:-ms-linear-gradient(top, #333333, #222222);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #222222));background-image:-webkit-linear-gradient(top, #333333, #222222);background-image:-o-linear-gradient(top, #333333, #222222);background-image:linear-gradient(top, #333333, #222222);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);-webkit-box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);-moz-box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);
@@ -98,53 +98,53 @@ h4 {
98 98
99 99
100 100
101   -}
  101 + }
102 102
103   -.ms-selectable, .ms-selection {
104   - width:292px;
105   -}
  103 + .ms-selectable, .ms-selection {
  104 + width:292px;
  105 + }
106 106
107   -.ms-container {
108   - background: none !important;
109   -}
  107 + .ms-container {
  108 + background: none !important;
  109 + }
110 110
111   -.ms-selectable {
112   - margin-right:10px !important;
113   - margin-bottom: 10px !important;
114   -}
  111 + .ms-selectable {
  112 + margin-right:10px !important;
  113 + margin-bottom: 10px !important;
  114 + }
115 115
116   -table.test_result {
117   - border-top:none;
118   -}
119   -table.test_result th, table.test_result td {
120   - padding:5px;
121   - line-height:1;
122   -}
  116 + table.test_result {
  117 + border-top:none;
  118 + }
  119 + table.test_result th, table.test_result td {
  120 + padding:5px;
  121 + line-height:1;
  122 + }
123 123
124   -embed.hidden {
125   - position: absolute;
126   - left: -10000px;
127   -}
  124 + embed.hidden {
  125 + position: absolute;
  126 + left: -10000px;
  127 + }
128 128
129   -</style>
130   -<div class="content" id="content1">
131   -
132   - <ul class="tabs">
133   - <li class="active"><a href="#tests_content">Apex Tests</a></li>
134   - <li class="game"><a href="#game_content">Pacman</a></li>
135   - <li class="results_hidden"><a href="#tests_results" id="a_result">Test Results</a></li>
136   - <li class="results_hidden"><a href="#class_coverage" id="b_result">Class Coverage</a></li>
137   - <li class="results_hidden"><a href="#trigger_coverage" id="c_result">Trigger Coverage</a></li>
138   - <li class="results_hidden"><a href="#warnings" id="d_result">Warnings</a></li>
139   - <li class="results_hidden"><a href="#log" id="e_result">Log</a></li>
140   - </ul>
141   -
142   - <div class="pill-content">
143   - <div class="active" id="tests_content">
144   - <div style="" class="headers">
145   - <form style="margin-bottom:5px;">
146   - <select id="tests" multiple="multiple" class="multiselect" style="display: none;">
147   - <%
  129 + </style>
  130 + <div class="content" id="content1">
  131 +
  132 + <ul class="tabs">
  133 + <li class="active"><a href="#tests_content">Apex Tests</a></li>
  134 + <li class="game"><a href="#arcade">Arcade</a></li>
  135 + <li class="results_hidden"><a href="#tests_results" id="a_result">Test Results</a></li>
  136 + <li class="results_hidden"><a href="#class_coverage" id="b_result">Class Coverage</a></li>
  137 + <li class="results_hidden"><a href="#trigger_coverage" id="c_result">Trigger Coverage</a></li>
  138 + <li class="results_hidden"><a href="#warnings" id="d_result">Warnings</a></li>
  139 + <li class="results_hidden"><a href="#log" id="e_result">Log</a></li>
  140 + </ul>
  141 +
  142 + <div class="pill-content">
  143 + <div class="active" id="tests_content">
  144 + <div style="" class="headers">
  145 + <form style="margin-bottom:5px;">
  146 + <select id="tests" multiple="multiple" class="multiselect" style="display: none;">
  147 + <%
148 148 selected_file = ENV['TM_FILEPATH'] || ENV['TM_SELECTED_FILE']
149 149 base_name = ""
150 150 if ! selected_file.nil? and selected_file.include? ".cls"
@@ -153,138 +153,154 @@ embed.hidden {
153 153 end
154 154 base_name = File.basename(selected_file, ".cls")
155 155 end
156   - %>
157   - <% classes.each do |cls| %>
  156 + %>
  157 + <% classes.each do |cls| %>
158 158 <% selected = (cls == base_name) ? "selected=\"selected\"" : "" %>
159 159 <option <%= selected %> value="<%= cls %>"><%= cls %></option>
160   - <% end %>
161   - </select>
162   - </form>
163   - </div>
164   - <form class="form" style="margin:0px;">
165   - <fieldset style="margin:0px;padding:0px;">
166   - <div class="clearfix">
167   - <label for="api" style="width:110px;margin-right:10px;">Endpoint</label>
168   - <select id="api">
169   - <option value="metadata">Metadata API</option>
170   - <option value="apex">Apex API</option>
171   - </select>
  160 + <% end %>