+ Snippet:
+
+
+ | Filter |
+ Source |
+ Rendered |
+
+
+ | linky filter |
+
+ <div ng-bind-html="snippet | linky"> </div>
+ |
+
+
+ |
+
+
+ | linky target |
+
+ <div ng-bind-html="snippetWithTarget | linky:'_blank'"> </div>
+ |
+
+
+ |
+
+
+ | no filter |
+ <div ng-bind="snippet"> </div> |
+ |
+
+
+
+
+ it('should linkify the snippet with urls', function() {
+ expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).
+ toBe('Pretty text with some links: http://angularjs.org/, us@somewhere.org, ' +
+ 'another@somewhere.org, and one more: ftp://127.0.0.1/.');
+ expect(element.all(by.css('#linky-filter a')).count()).toEqual(4);
+ });
+
+ it('should not linkify snippet without the linky filter', function() {
+ expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()).
+ toBe('Pretty text with some links: http://angularjs.org/, mailto:us@somewhere.org, ' +
+ 'another@somewhere.org, and one more: ftp://127.0.0.1/.');
+ expect(element.all(by.css('#escaped-html a')).count()).toEqual(0);
+ });
+
+ it('should update', function() {
+ element(by.model('snippet')).clear();
+ element(by.model('snippet')).sendKeys('new http://link.');
+ expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).
+ toBe('new http://link.');
+ expect(element.all(by.css('#linky-filter a')).count()).toEqual(1);
+ expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText())
+ .toBe('new http://link.');
+ });
+
+ it('should work with the target property', function() {
+ expect(element(by.id('linky-target')).
+ element(by.binding("snippetWithTarget | linky:'_blank'")).getText()).
+ toBe('http://angularjs.org/');
+ expect(element(by.css('#linky-target a')).getAttribute('target')).toEqual('_blank');
+ });
+
+
+ */
+angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {
+ var LINKY_URL_REGEXP =
+ /((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"”’]/,
+ MAILTO_REGEXP = /^mailto:/;
+
+ return function(text, target) {
+ if (!text) return text;
+ var match;
+ var raw = text;
+ var html = [];
+ var url;
+ var i;
+ while ((match = raw.match(LINKY_URL_REGEXP))) {
+ // We can not end in these as they are sometimes found at the end of the sentence
+ url = match[0];
+ // if we did not match ftp/http/www/mailto then assume mailto
+ if (!match[2] && !match[4]) {
+ url = (match[3] ? 'http://' : 'mailto:') + url;
+ }
+ i = match.index;
+ addText(raw.substr(0, i));
+ addLink(url, match[0].replace(MAILTO_REGEXP, ''));
+ raw = raw.substring(i + match[0].length);
+ }
+ addText(raw);
+ return $sanitize(html.join(''));
+
+ function addText(text) {
+ if (!text) {
+ return;
+ }
+ html.push(sanitizeText(text));
+ }
+
+ function addLink(url, text) {
+ html.push('
');
+ addText(text);
+ html.push('');
+ }
+ };
+}]);
+
+
+})(window, window.angular);
diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css
index eb02f31c..daa86044 100644
--- a/public/stylesheets/main.css
+++ b/public/stylesheets/main.css
@@ -190,4 +190,110 @@ div[ui-view] {
.contain-to-grid .top-bar {
max-width: 90%;
}
+}
+
+#mission-input {
+ margin-top: 0;
+ height: 512px;
+}
+
+#mission-preview {
+ overflow: scroll;
+ margin-top: 0;
+ height: 512px;
+}
+
+#drop-color a {
+ display: inline-block;
+}
+
+.color-preview {
+ display: inline-block;
+ width: 5%;
+ padding-top: 5%;
+ margin-left: 4%;
+ margin-right: 4%;
+ border-radius: 50%;
+ vertical-align: middle;
+ box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.3);
+}
+
+.color-preview-custom {
+ background: red; /* not working, let's see some red */
+ background: -moz-linear-gradient( top ,
+ rgba(255, 0, 0, 1) 0%,
+ rgba(255, 255, 0, 1) 15%,
+ rgba(0, 255, 0, 1) 30%,
+ rgba(0, 255, 255, 1) 50%,
+ rgba(0, 0, 255, 1) 65%,
+ rgba(255, 0, 255, 1) 80%,
+ rgba(255, 0, 0, 1) 100%);
+ background: -webkit-gradient(linear, left top, left bottom,
+ color-stop(0%, rgba(255, 0, 0, 1)),
+ color-stop(15%, rgba(255, 255, 0, 1)),
+ color-stop(30%, rgba(0, 255, 0, 1)),
+ color-stop(50%, rgba(0, 255, 255, 1)),
+ color-stop(65%, rgba(0, 0, 255, 1)),
+ color-stop(80%, rgba(255, 0, 255, 1)),
+ color-stop(100%, rgba(255, 0, 0, 1)));
+}
+
+.cursor-pipette {
+ cursor: url('../images/pipette-cursor.gif') 0 14, auto;
+}
+
+.cursor-paint {
+ cursor: url('../images/paint-cursor.png') 0 18, auto;
+}
+
+.color-indic-li {
+ position: relative;
+}
+
+.color-indic {
+ position: absolute;
+ top: -14px;
+ left: 8px;
+ width: 25px;
+ height: 25px;
+ border-radius: 50%;
+ border: 3px solid #fff;
+ box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.5);
+ z-index: 10;
+}
+
+.color-indic.ng-hide-add,
+.color-indic.ng-hide-remove,
+.color-indic.ng-show-add,
+.color-indic.ng-show-remove {
+ -webkit-transition: all linear 0.2s;
+ -moz-transition: all linear 0.2s;
+ -o-transition: all linear 0.2s;
+ transition: all linear 0.2s;
+}
+
+.color-indic.ng-hide-add.ng-hide-add-active,
+.color-indic.ng-hide-remove,
+.color-indic.ng-show-add.ng-show-add-active,
+.color-indic.ng-show-remove
+{
+ opacity: 0;
+}
+
+.color-indic.ng-hide-add,
+.color-indic.ng-hide-remove.ng-hide-remove-active,
+.color-indic.ng-show-add,
+.color-indic.ng-show-remove.ng-show-remove-active
+{
+ opacity: 1;
+}
+
+button.selected-btn, button.selected-btn:focus, button.selected-btn:active, button.selected-btn:hover {
+ background-color: #006586;
+ box-shadow: 0px 2px 3px #00516B inset;
+}
+
+#select-world-row .columns {
+ padding-top: 0;
+ padding-bottom: 0;
}
\ No newline at end of file