<commit_before>#= require ./../../vendor/ui-bootstrap/ui-bootstrap-tpls-0.2.0

#= require ./../services/visitor
#= require ./../services/session
#= require ./../services/downloader
#= require ./../services/panes

module = angular.module "plunker.toolbar", [
  "plunker.visitor"
  "plunker.session"
  "plunker.downloader"
  "plunker.notifier"
  "plunker.panes"
  "ui.bootstrap"
]

module.directive "plunkerToolbar", ["$location", "session", "downloader", "notifier", "panes", ($location, session, downloader, notifier, panes) ->
  restrict: "E"
  scope: {}
  replace: true
  template: """
    <div class="plunker-toolbar btn-toolbar">
      <div class="btn-group" ng-show="!session.plunk || session.plunk.isWritable()">
        <button ng-disabled="!session.isPlunkDirty()" ng-click="session.save()" class="btn btn-primary" tooltip-placement="bottom" tooltip="Save your work as a new Plunk">
          <i class="icon-save"></i><span class="shrink"> Save</span>
        </button>
      </div>
      <div class="btn-group" ng-show="session.isSaved()">
        <button ng-disabled="!session.isPlunkDirty()" ng-click="session.fork()" class="btn" tooltip-placement="bottom" tooltip="Save your changes as a fork of this Plunk">
          <i class="icon-git-fork"></i><span class="shrink"> Fork</span>
        </button>
        <button ng-disabled="!session.isPlunkDirty()" data-toggle="dropdown" class="btn dropdown-toggle" tooltip-placement="bottom" tooltip="Fork and toggle the privacy of this Plunk"><span class="caret"></span></button>
        <ul class="dropdown-menu" ng-switch on="session.private">
          <li ng-switch-when="false"><a ng-click="session.fork({private: true})">Fork to private plunk</a></li>
          <li ng-switch-when="true"><a ng-click="session.fork({private: false})">Fork to public plunk</a></li>
        </ul>
      </div>
      <div ng-show="session.plunk.isWritable() && session.plunk.isSaved()" class="btn-group">
        <button ng-click="promptDestroy()" class="btn btn-danger" tooltip-placement="bottom" tooltip="Delete the current plunk">
          <i class="icon-trash"></i>
        </button>
      </div>
      <div class="btn-group">
        <button ng-click="promptReset()" class="btn btn-success" tooltip-placement="bottom" tooltip="Create a new Plunk">
          <i class="icon-file"></i><span class="shrink"> New</span>
        </button>
        <button data-toggle="dropdown" class="btn btn-success dropdown-toggle" tooltip-placement="bottom" tooltip="Create a new Plunk from a template"><span class="caret"></span></button>
        <ul class="dropdown-menu">
          <li><a href="/edit/gist:1986619">jQuery<a href="/edit/gist:1992850" class="coffee" title="In coffee-script"><img src="/img/coffeescript-logo-small_med.png"></a></a></li>
          <li><a href="/edit/gist:2006604">jQuery UI</a></li>
          <li class="divider"></li>
          <li class="dropdown-submenu">
            <a tabindex="-1" href="#">AngularJS</a>
            <ul class="dropdown-menu">
              <li><a href="/edit/gist:3510140">1.0.1<a href="/edit/gist:3189582" class="coffee" title="In coffee-script"><img src="/img/coffeescript-logo-small_med.png"></a></a></li>
              <li class="divider"></li>
              <li><a href="/edit/gist:3662656">1.0.2<a href="/edit/gist:3662659" class="coffee" title="In coffee-script"><img src="/img/coffeescript-logo-small_med.png"></a></a></li>
              <li><a href="/edit/gist:3743008">1.0.2 + Jasmine</a></li>
              <li class="divider"></li>
              <li><a href="/edit/gist:3662702">1.1.0 (unstable)<a href="/edit/gist:3662696" class="coffee" title="In coffee-script"><img src="/img/coffeescript-logo-small_med.png"></a></a></li>
            </ul>
          </li>
          <li class="divider"></li>
          <li><a href="/edit/gist:2016721">Bootstrap<a href="/edit/gist:2016721" class="coffee" title="In coffee-script"><img src="/img/coffeescript-logo-small_med.png"></a></a></li>
          <li class="divider"></li>
          <li><a href="/edit/gist:2050713">Backbone.js<a href="/edit/gist:2050746" class="coffee" title="In coffee-script"><img src="/img/coffeescript-logo-small_med.png"></a></a></li>
          <li class="divider"></li>
          <li><a href="/edit/gist:3510115">YUI</a></li>
          <li class="divider"></li>
          <li>
            <a href="javascript:void(0)" ng-click="promptImportGist()" title="Import code from a gist or another plunk">Import gist...</a>
          </li>
          <li class="divider"></li>
          <li>
            <div ng-click="builder.launch()" title="Launch the Plunk builder (coming soon...)"><i class="icon-beaker"></i>Launch builder...</div>
          </li>
        </ul>
      </div>
      <div class="btn-group">
        <button ng-click="togglePreview()" class="btn btn-inverse" ng-class="{active: panes.active.id=='preview'}" ng-switch on="panes.active.id=='preview'" tooltip-placement="bottom" tooltip="Preview your work">
          <div ng-switch-when="false">
            <i class="icon-play" />
            <span class="shrink">Run</span>
          </div>
          <div ng-switch-when="true">
            <i class="icon-stop" />
            <span class="shrink">Stop</span>
          </div>
        </button>
      </div>
      <div class="btn-group pull-right">
        <button ng-click="triggerDownload()" class="btn" tooltip-placement="bottom" tooltip="Download your Plunk as a zip file">
          <i class="icon-download-alt" />
        </button>
      </div>
      <div class="btn-group pull-right" ng-show="session.isSaved()"><commit_msg>Update templates (until new system in place)<commit_after>#= require ./../../vendor/ui-bootstrap/ui-bootstrap-tpls-0.2.0

#= require ./../services/visitor
#= require ./../services/session
#= require ./../services/downloader
#= require ./../services/panes

module = angular.module "plunker.toolbar", [
  "plunker.visitor"
  "plunker.session"
  "plunker.downloader"
  "plunker.notifier"
  "plunker.panes"
  "ui.bootstrap"
]

module.directive "plunkerToolbar", ["$location", "session", "downloader", "notifier", "panes", ($location, session, downloader, notifier, panes) ->
  restrict: "E"
  scope: {}
  replace: true
  template: """
    <div class="plunker-toolbar btn-toolbar">
      <div class="btn-group" ng-show="!session.plunk || session.plunk.isWritable()">
        <button ng-disabled="!session.isPlunkDirty()" ng-click="session.save()" class="btn btn-primary" tooltip-placement="bottom" tooltip="Save your work as a new Plunk">
          <i class="icon-save"></i><span class="shrink"> Save</span>
        </button>
      </div>
      <div class="btn-group" ng-show="session.isSaved()">
        <button ng-disabled="!session.isPlunkDirty()" ng-click="session.fork()" class="btn" tooltip-placement="bottom" tooltip="Save your changes as a fork of this Plunk">
          <i class="icon-git-fork"></i><span class="shrink"> Fork</span>
        </button>
        <button ng-disabled="!session.isPlunkDirty()" data-toggle="dropdown" class="btn dropdown-toggle" tooltip-placement="bottom" tooltip="Fork and toggle the privacy of this Plunk"><span class="caret"></span></button>
        <ul class="dropdown-menu" ng-switch on="session.private">
          <li ng-switch-when="false"><a ng-click="session.fork({private: true})">Fork to private plunk</a></li>
          <li ng-switch-when="true"><a ng-click="session.fork({private: false})">Fork to public plunk</a></li>
        </ul>
      </div>
      <div ng-show="session.plunk.isWritable() && session.plunk.isSaved()" class="btn-group">
        <button ng-click="promptDestroy()" class="btn btn-danger" tooltip-placement="bottom" tooltip="Delete the current plunk">
          <i class="icon-trash"></i>
        </button>
      </div>
      <div class="btn-group">
        <button ng-click="promptReset()" class="btn btn-success" tooltip-placement="bottom" tooltip="Create a new Plunk">
          <i class="icon-file"></i><span class="shrink"> New</span>
        </button>
        <button data-toggle="dropdown" class="btn btn-success dropdown-toggle" tooltip-placement="bottom" tooltip="Create a new Plunk from a template"><span class="caret"></span></button>
        <ul class="dropdown-menu">
          <li><a href="/edit/gist:1986619">jQuery<a href="/edit/gist:1992850" class="coffee" title="In coffee-script"><img src="/img/coffeescript-logo-small_med.png"></a></a></li>
          <li><a href="/edit/gist:2006604">jQuery UI</a></li>
          <li class="divider"></li>
          <li class="dropdown-submenu">
            <a tabindex="-1" href="#">AngularJS</a>
            <ul class="dropdown-menu">
              <li><a href="/edit/gist:3510140">1.0.5<a href="/edit/gist:3189582" class="coffee" title="In coffee-script"><img src="/img/coffeescript-logo-small_med.png"></a></a></li>
              <li><a href="/edit/gist:5301635">1.0.5 + Jasmine</a></li>
              <li class="divider"></li>
              <li><a href="/edit/gist:3662702">1.1.0 (unstable)<a href="/edit/gist:3662696" class="coffee" title="In coffee-script"><img src="/img/coffeescript-logo-small_med.png"></a></a></li>
            </ul>
          </li>
          <li class="divider"></li>
          <li><a href="/edit/gist:2016721">Bootstrap<a href="/edit/gist:2016721" class="coffee" title="In coffee-script"><img src="/img/coffeescript-logo-small_med.png"></a></a></li>
          <li class="divider"></li>
          <li><a href="/edit/gist:2050713">Backbone.js<a href="/edit/gist:2050746" class="coffee" title="In coffee-script"><img src="/img/coffeescript-logo-small_med.png"></a></a></li>
          <li class="divider"></li>
          <li><a href="/edit/gist:3510115">YUI</a></li>
        </ul>
      </div>
      <div class="btn-group">
        <button ng-click="togglePreview()" class="btn btn-inverse" ng-class="{active: panes.active.id=='preview'}" ng-switch on="panes.active.id=='preview'" tooltip-placement="bottom" tooltip="Preview your work">
          <div ng-switch-when="false">
            <i class="icon-play" />
            <span class="shrink">Run</span>
          </div>
          <div ng-switch-when="true">
            <i class="icon-stop" />
            <span class="shrink">Stop</span>
          </div>
        </button>
      </div>
      <div class="btn-group pull-right">
        <button ng-click="triggerDownload()" class="btn" tooltip-placement="bottom" tooltip="Download your Plunk as a zip file">
          <i class="icon-download-alt" />
        </button>
      </div>
      <div class="btn-group pull-right" ng-show="session.isSaved()">
{'fraction_non_alphanumeric': 0.20283152430391693, 'fraction_numerical': 0.021330816422840963, 'mean_word_length': 3.155294117647059, 'pattern_counts': {'":': 0, '<': 294, '<?xml version=': 0, '>': 296, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7230331', 'n_tokens_mistral': 3648, 'n_tokens_neox': 3456, 'n_words': 618}