Permalink
Browse files

move settings.html to js templates

  • Loading branch information...
1 parent 244ac93 commit bf78bc3fd273d0608637c699360b501dc2839566 @tkurz committed May 16, 2013
Showing with 67 additions and 106 deletions.
  1. +1 −1 .gitignore
  2. +4 −0 README.md
  3. +0 −96 html/settings.html
  4. +55 −1 js/templates.js
  5. +7 −8 skos-editor.0.2.0.js
View
@@ -1,2 +1,2 @@
*~
-target
+target/*
View
@@ -17,3 +17,7 @@ Online demo
LICENSE
=======
Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html)
+
+BUILD WEBJAR
+============
+Use maven to build the webjar. mvn package
View
@@ -1,96 +0,0 @@
-<style type="text/css">
- h1#popup_title {
- margin:0;
- padding:6px;
- background-color:#FFC414;
- color: black;
- font-size: 14px;
- border-bottom: 1px solid black;
- border-top: 1px solid #d3d3d3;
- border-right: 1px solid #d3d3d3;
- border-left: 1px solid #d3d3d3;
- }
- ul#settingslist {
- margin:0;list-style: none;padding: 0
- }
- ul#settingslist li{
- border-bottom: 1px dashed white;padding:5px;
- color:#333333;
- }
- ul#settingslist li.active{
- font-weight: bold;
- }
- ul#settingslist li:hover{
- cursor:pointer;
- font-weight: bold;
- }
- ul#settings_language_list {
- list-style: none;
- padding: 0;
- margin: 0;
- }
- ul#settings_language_list li {
- margin: 0;
- padding: 0 0 5px;
- }
- ul#settings_language_list span {
- border: 1px solid #999;
- padding: 1px 3px;
- border-radius: 2px 2px 2px 2px;
- background-color: #f3f3f3;
- }
-
-</style>
-<script type="text/javascript">
- function __activate(node) {
- $("#settingslist .active").removeClass("active");
- $(node).addClass("active");
- $(".settingslist_current").hide();
- $("#settingslist_"+$(node).attr('name')).addClass('settingslist_current').show();
- }
-</script>
-<div style="width:500px;margin-left:-250px;top:100px;border:1px solid black;background-color:white;position:relative;height:400px">
- <h1 id="popup_title" class="alert_title">Settings</h1>
- <span id="popup_close" class='popup_cancel'>&nbsp;</span>
- <div>
- <div style="font-size: 12px;float:left;background-color:white;border-bottom:1px solid #bbbbbb">
- <div style="width:200px;float:left;background-color: #d3d3d3; height:330px;">
- <ul id="settingslist">
- <li class="active" onclick="__activate(this)" name="language">Languages</li>
- <li onclick="__activate(this)" name="other">Other</li>
- </ul>
- </div>
- <div style="width:300px;float:left;height:300px">
- <div class="settingslist_current" id="settingslist_language" style="padding: 5px">
- <table>
- <tr><td style="vertical-align:top;width:190px;padding-top: 5px;">Displayed Languages</td><td>
- <ul id="settings_language_list">
- <!--<li><span>de</span><button class="button"><i class="icon-minus"></i></button></li>
- <li><span>en</span><button class="button"><i class="icon-minus"></i></button></li>-->
- </ul>
- </td></tr>
- <tr><td>Add Language</td><td>
- <input id="settings_language_newLanguageInput" type="text" maxlength="5" style="width: 40px">
- <button id="settings_language_newLanguageButton" class="button"><i class="icon-plus"></i></button>
- </td></tr>
- <tr><td>First Language</td><td>
- <select id="settings_language_firstLanguageSelect">
- <!--<option>none</option>
- <option>de</option>-->
- </select>
- </td></tr>
- </table>
- <p style="color:red" id="settings_language_info"></p>
- </div>
- <div style="display:none;padding: 5px" id="settingslist_other">
- No more Settings possible at the moment ...
- </div>
- </div>
- <div class="clear"></div>
- </div>
- <div style="margin-top:10px;width: 100%;text-align: center;float:left;">
- <button class="popup_cancel">OK</button>
- </div>
- <div class="clear"></div>
- </div>
-</div>
View
@@ -211,6 +211,60 @@ var HTML_TEMPLATES = {
' </div>' +
' </div>' +
'</div>',
- settings:''
+ settings:'<style type="text/css">' +
+ 'h1#popup_title {margin:0;padding:6px;background-color:#FFC414;color: black;font-size: 14px;border-bottom: 1px solid black;border-top: 1px solid #d3d3d3;border-right: 1px solid #d3d3d3;border-left: 1px solid #d3d3d3;}'+
+ 'ul#settingslist {margin:0;list-style: none;padding: 0}'+
+ 'ul#settingslist li{border-bottom: 1px dashed white;padding:5px;color:#333333;}'+
+ 'ul#settingslist li.active{font-weight: bold;}'+
+ 'ul#settingslist li:hover{cursor:pointer;font-weight: bold;}'+
+ 'ul#settings_language_list {list-style: none;padding: 0;margin: 0;}'+
+ 'ul#settings_language_list li {margin: 0;padding: 0 0 5px;}'+
+ 'ul#settings_language_list span {border: 1px solid #999;padding: 1px 3px;border-radius: 2px 2px 2px 2px;background-color: #f3f3f3;}'+
+ '</style>'+
+ '<div style="width:500px;margin-left:-250px;top:100px;border:1px solid black;background-color:white;position:relative;height:400px">'+
+ ' <h1 id="popup_title" class="alert_title">Settings</h1>'+
+ ' <span id="popup_close" class="popup_cancel">&nbsp;</span>'+
+ ' <div>'+
+ ' <div style="font-size: 12px;float:left;background-color:white;border-bottom:1px solid #bbbbbb">'+
+ ' <div style="width:200px;float:left;background-color: #d3d3d3; height:330px;">'+
+ ' <ul id="settingslist">'+
+ ' <li class="active" onclick="__activate(this)" name="language">Languages</li>'+
+ ' <!--<li onclick="__activate(this)" name="other">Other</li>-->'+
+ ' </ul>'+
+ ' </div>'+
+ ' <div style="width:300px;float:left;height:300px">'+
+ ' <div class="settingslist_current" id="settingslist_language" style="padding: 5px">'+
+ ' <table>'+
+ ' <tr><td style="vertical-align:top;width:190px;padding-top: 5px;">Displayed Languages</td><td>'+
+ ' <ul id="settings_language_list">'+
+ ' <!--<li><span>de</span><button class="button"><i class="icon-minus"></i></button></li>'+
+ ' <li><span>en</span><button class="button"><i class="icon-minus"></i></button></li>-->'+
+ ' </ul>'+
+ ' </td></tr>'+
+ ' <tr><td>Add Language</td><td>'+
+ ' <input id="settings_language_newLanguageInput" type="text" maxlength="5" style="width: 40px">'+
+ ' <button id="settings_language_newLanguageButton" class="button"><i class="icon-plus"></i></button>'+
+ ' </td></tr>'+
+ ' <tr><td>First Language</td><td>'+
+ ' <select id="settings_language_firstLanguageSelect">'+
+ ' <!--<option>none</option>'+
+ ' <option>de</option>-->'+
+ ' </select>'+
+ ' </td></tr>'+
+ ' </table>'+
+ ' <p style="color:red" id="settings_language_info"></p>'+
+ ' </div>'+
+ ' <div style="display:none;padding: 5px" id="settingslist_other">'+
+ ' No more Settings possible at the moment ...'+
+ ' </div>'+
+ ' </div>'+
+ ' <div class="clear"></div>'+
+ ' </div>'+
+ ' <div style="margin-top:10px;width: 100%;text-align: center;float:left;">'+
+ ' <button class="popup_cancel">OK</button>'+
+ ' </div>'+
+ ' <div class="clear"></div>'+
+ ' </div>'+
+ '</div>'
}
}
View
@@ -2072,15 +2072,14 @@ function SKOSEditor(options) {
var timeout;
$("#"+background).show();
- $("#" + container).load("html/settings.html", function() {
- $(".popup_cancel").click(function() {
- clearTimeout(timeout);
- close();
- if(updated)events.fire(new Event(EventCode.SETTINGS.UPDATED));
- });
- //write data
- init();
+ $("#" + container).html(HTML_TEMPLATES.popups.settings);
+ $(".popup_cancel").click(function() {
+ clearTimeout(timeout);
+ close();
+ if(updated)events.fire(new Event(EventCode.SETTINGS.UPDATED));
});
+ //write data
+ init();
function init() {

0 comments on commit bf78bc3

Please sign in to comment.