Browse Source

- Remove steditor

- Add Markdown support in post submit form
- Add post geolocalisation
- Clean some old code
- Fix Popup CSS
- Add some new icons for the buttons
pull/16/head
Jaussoin Timothée 13 years ago
parent
commit
0c48619f24
  1. 3
      loader.php
  2. 3096
      system/Markdown.php
  3. 211
      system/Widget/WidgetCommon.php
  4. 2
      system/Widget/widgets/About/About.php
  5. 30
      system/Widget/widgets/Bookmark/Bookmark.php
  6. 5
      system/Widget/widgets/Chat/chat.css
  7. 10
      system/Widget/widgets/ContactInfo/ContactInfo.php
  8. 2
      system/Widget/widgets/Feed/Feed.php
  9. 2
      system/Widget/widgets/ProfileData/ProfileData.php
  10. 3
      system/Widget/widgets/Roster/Roster.php
  11. BIN
      system/js/images/bold.png
  12. BIN
      system/js/images/center.png
  13. BIN
      system/js/images/h1.png
  14. BIN
      system/js/images/h2.png
  15. BIN
      system/js/images/h3.png
  16. BIN
      system/js/images/h4.png
  17. BIN
      system/js/images/help.gif
  18. BIN
      system/js/images/indent.png
  19. BIN
      system/js/images/italic.png
  20. BIN
      system/js/images/left.png
  21. BIN
      system/js/images/link.png
  22. BIN
      system/js/images/ol.png
  23. BIN
      system/js/images/outdent.png
  24. BIN
      system/js/images/paragraph.png
  25. BIN
      system/js/images/picture.png
  26. BIN
      system/js/images/right.png
  27. BIN
      system/js/images/ul.png
  28. BIN
      system/js/images/underline.png
  29. 30
      system/js/movim.js
  30. 207
      system/js/steditor.js
  31. 49
      themes/movim/css/forms.css
  32. 38
      themes/movim/css/style2.css
  33. 28
      themes/movim/css/submitform.css
  34. BIN
      themes/movim/img/icons/button/arrow-left.png
  35. BIN
      themes/movim/img/icons/button/arrow-right.png
  36. BIN
      themes/movim/img/icons/button/chat.png
  37. BIN
      themes/movim/img/icons/button/checkmark.png
  38. BIN
      themes/movim/img/icons/button/close.png
  39. BIN
      themes/movim/img/icons/button/comment.png
  40. BIN
      themes/movim/img/icons/button/envelope.png
  41. BIN
      themes/movim/img/icons/button/feed.png
  42. BIN
      themes/movim/img/icons/button/image.png
  43. BIN
      themes/movim/img/icons/button/link.png
  44. BIN
      themes/movim/img/icons/button/location.png
  45. BIN
      themes/movim/img/icons/button/loop.png
  46. BIN
      themes/movim/img/icons/button/minus.png
  47. BIN
      themes/movim/img/icons/button/pencil.png
  48. BIN
      themes/movim/img/icons/button/plus.png
  49. BIN
      themes/movim/img/icons/button/quill.png
  50. BIN
      themes/movim/img/icons/button/remove.png
  51. BIN
      themes/movim/img/icons/button/support.png
  52. BIN
      themes/movim/img/icons/button/upload.png
  53. 1
      themes/movim/page.tpl

3
loader.php

@ -28,6 +28,9 @@ require_once(LIB_PATH . "RPC.php");
require_once(LIB_PATH . "User.php");
require_once(LIB_PATH . "XMPPtoForm.php");
// Markdown lib
require_once(LIB_PATH . "Markdown.php");
// We load Movim Data Layer
require_once(LIB_PATH . 'Modl/loader.php');

3096
system/Markdown.php
File diff suppressed because it is too large
View File

211
system/Widget/WidgetCommon.php

@ -544,48 +544,117 @@ class WidgetCommon extends WidgetBase {
protected function prepareSubmitForm($server = '', $node = '') {
$html = '
<script type="text/javascript">
function showPosition(poss) {
'.$this->genCallAjax('ajaxShowPosition', "poss").'
}
</script>
<div class="popup" id="markdownhelp">
<a
class="button tiny black"
style="float: right;"
onclick="
movim_toggle_display(\'#markdownhelp\');"
>'.t('Close').'</a>
<h2>Title level</h2>
<pre>
A First Level Header
====================
A Second Level Header
---------------------
Now is the time for all good men to come to
the aid of their country. This is just a
regular paragraph.
The quick brown fox jumped over the lazy
dog\'s back.
### Header 3
> This is a blockquote.
>
> This is the second paragraph in the blockquote.
>
> ## This is an H2 in a blockquote
</pre>
<h2>Phrase Emphasis</h2>
<pre>
Some of these words *are emphasized*.
Some of these words _are emphasized also_.
Use two asterisks for **strong emphasis**.
Or, if you prefer, __use two underscores instead__.
</pre>
<h2>Lists</h2>
<pre>
* Candy.
* Gum.
* Booze.
</pre>
<h2>Links</h2>
<pre>
This is an [example link](http://example.com/).
</pre>
<h2>Learn more</h2>
<p>
<a href="http://daringfireball.net/projects/markdown/basics" target="_blank">
The whole help is avaiable here : http://daringfireball.net/projects/markdown/basics
</a>
</p>
<p>
<br />
</p>
</div>
<table id="feedsubmitform">
<tbody>
<tr>
<td>
<textarea
placeholder="'.t("What's new ?").'"
id="feedmessagecontent"
class="steditor"
onkeyup="movim_textarea_autoheight(this);"></textarea>
</td>
</tr>
<script type="text/javascript">
var ste = new SimpleTextEditor("feedmessagecontent", "ste");
ste.init();
</script>
<tr id="feedsubmitrow">
<td>
<a
title="Plus"
href="#"
onclick="frameHeight(this);"
style="float: left;"
class="button tiny icon add merged left">'.t("Size").'
</a>
<a
title="Rich"
href="#"
onclick="richText(this);"
style="float: left;"
class="button tiny icon yes merged right">'.t("Rich Text").'
</a>
<a
title="'.t("Submit").'"
href="#"
id="feedmessagesubmit"
onclick="ste.submit();'.$this->genCallAjax('ajaxPublishItem', "'".$server."'", "'".$node."'",'getFeedMessage()').'; ste.clearContent();"
class="button tiny icon submit">'.t("Submit").'
</a>
</td>
</tr>
<form name="postpublish" id="postpublish">
<tr>
<td>
<textarea
name="content"
id="postpublishcontent"
onkeyup="movim_textarea_autoheight(this);"
placeholder="'.t("What's new ?").'" ></textarea>
</td>
</tr>
<tr id="feedsubmitrow">
<td>
<input type="hidden" id="latlonpos" name="latlonpos"/>
<a
title="'.t("Submit").'"
href="#"
id="feedmessagesubmit"
onclick="'.$this->genCallAjax('ajaxPublishItem', "'".$server."'", "'".$node."'","movim_parse_form('postpublish')").';
document.querySelector(\'#postpublish\').reset();
movim_textarea_autoheight(document.querySelector(\'#postpublishcontent\'));"
class="button tiny icon yes">'.
t("Submit").'
</a>
<a
title="Plus"
href="#"
id="postpublishsize"
onclick="frameHeight(this, document.querySelector(\'#postpublishcontent\'));"
style="float: left;"
class="button tiny icon alone add merged left"></a><a
class="button tiny icon alone help merged"
style="float: left;"
onclick="
movim_toggle_display(\'#markdownhelp\');"
></a><a title="'.t("Geolocalisation").'"
onclick="setPosition(document.querySelector(\'#latlonpos\'));"
style="float: left;"
class="button tiny icon alone geo merged right"></a>
<span id="postpublishlocation"></span>
</td>
</tr>
</form>
</tbody>
</table>';
@ -593,6 +662,56 @@ class WidgetCommon extends WidgetBase {
return $html;
}
function ajaxShowPosition($pos)
{
list($lat,$lon) = explode(',', $pos);
$pos = json_decode(
file_get_contents('http://nominatim.openstreetmap.org/reverse?format=json&lat='.$lat.'&lon='.$lon.'&zoom=27&addressdetails=1')
);
RPC::call('movim_fill', 'postpublishlocation' , (string)$pos->display_name);
RPC::commit();
}
function ajaxPublishItem($server, $node, $form)
{
$content = $form['content'];
list($lat,$lon) = explode(',', $form['latlonpos']);
$pos = json_decode(
file_get_contents('http://nominatim.openstreetmap.org/reverse?format=json&lat='.$lat.'&lon='.$lon.'&zoom=27&addressdetails=1')
);
$geo = array(
'latitude' => (string)$pos->lat,
'longitude' => (string)$pos->lon,
'altitude' => (string)$pos->alt,
'country' => (string)$pos->address->country,
'countrycode' => (string)$pos->address->country_code,
'region' => (string)$pos->address->county,
'postalcode' => (string)$pos->address->postcode,
'locality' => (string)$pos->address->city,
'street' => (string)$pos->address->path,
'building' => (string)$pos->address->building,
'text' => (string)$pos->display_name,
'uri' => ''//'http://www.openstreetmap.org/'.urlencode('?lat='.(string)$pos->lat.'&lon='.(string)$pos->lon.'&zoom=10')
);
if($content != '') {
$content = Michelf\Markdown::defaultTransform($content);
$p = new moxl\PubsubPostPublish();
$p->setFrom($this->user->getLogin())
->setTo($server)
->setNode($node)
->setLocation($geo)
->setContentHtml(htmlspecialchars(rawurldecode($content)))
->request();
}
}
function onPostPublishError($error) {
Notification::appendNotification(t('Error').' : '.$error, 'error');
}
@ -639,18 +758,6 @@ class WidgetCommon extends WidgetBase {
->request();
}
function ajaxPublishItem($server, $node, $content)
{
if($content != '') {
$p = new moxl\PubsubPostPublish();
$p->setFrom($this->user->getLogin())
->setTo($server)
->setNode($node)
->setContent(htmlspecialchars(rawurldecode($content)))
->request();
}
}
function ajaxPublishComment($to, $id, $content) {
if($content != '') {
$p = new moxl\MicroblogCommentPublish();

2
system/Widget/widgets/About/About.php

@ -109,7 +109,7 @@ class About extends WidgetBase
<br />
<dl>
<dt>Map Library</dt><dd>Leaflet <a href="http://leafletjs.com/">leafletjs.com</a> under BSD</dd>
<dt>WYSIWYG editor</dt><dd>STDEditor <a href="http://code.google.com/p/steditor/">code.google.com</a> under BSD</dd>
<dt>Markdown</dt><dd>Michel Fortin <a href="http://michelf.ca/projects/php-markdown/">michelf.ca</a> ©Michel Fortin</dd>
<dt>HTML Fixer</dt><dd> Giulio Pons <a href="http://www.barattalo.it">barattalo.it</a></dd>
</dl>
<h2><?php echo t('Ressources'); ?></h2>

30
system/Widget/widgets/Bookmark/Bookmark.php

@ -113,6 +113,7 @@ class Bookmark extends WidgetBase
function ajaxBookmarkAdd($form)
{
\movim_log($form);
if(!filter_var($form['url'], FILTER_VALIDATE_URL)) {
$html = '<div class="message error">'.t('Bad URL').'</div>' ;
RPC::call('movim_fill', 'bookmarkadderror', $html);
@ -121,20 +122,21 @@ class Bookmark extends WidgetBase
$html = '<div class="message error">'.t('Empty name').'</div>' ;
RPC::call('movim_fill', 'bookmarkadderror', $html);
RPC::commit();
}
$bookmarks = Cache::c('bookmark');
if($bookmarks == null)
$bookmarks = array();
} else {
array_push($bookmarks,
array(
'type' => 'url',
'name' => $form['name'],
'url' => $form['url']));
$this->ajaxSetBookmark($bookmarks);
$bookmarks = Cache::c('bookmark');
if($bookmarks == null)
$bookmarks = array();
array_push($bookmarks,
array(
'type' => 'url',
'name' => $form['name'],
'url' => $form['url']));
$this->ajaxSetBookmark($bookmarks);
}
}
function ajaxBookmarkUrlRemove($url)
@ -271,7 +273,7 @@ class Bookmark extends WidgetBase
<br />
<a class="button icon yes tiny merged right" style="float: right;"
onclick="movim_toggle_display('#bookmarkadd')">Add</a>
<a class="button icon submit tiny merged left" style="float: right;"
<a class="button icon refresh tiny merged left" style="float: right;"
onclick="<?php echo $getbookmark; ?>">Refresh</a>
<br />
<?php

5
system/Widget/widgets/Chat/chat.css

@ -149,9 +149,12 @@
overflow: auto;
background-color: white;
resize: none;
height: 1em;
/*height: 1em;
line-height: 1em;
font-size: 1em;*/
font-size: 1em;
height: 1.3em;
overflow-y: hidden;
}
#chats .chat .panel .text textarea:focus {

10
system/Widget/widgets/ContactInfo/ContactInfo.php

@ -54,9 +54,15 @@ class ContactInfo extends WidgetCommon
$html .= t("I'm ").substr($mood, 0, -1).'<br />';
}
if($c->tuneartist) {
if($c->tuneartist || $c->tunetitle) {
$html .= '<h2>'.t('Listening').'</h2>';
$html .= $c->tuneartist. ' - '.$c->tunetitle.' '.t('on').' '.$c->tunesource;
if($c->tuneartist)
$artist = $c->tuneartist. ' - ';
if($c->tunetitle)
$title = $c->tunetitle;
if($c->tunesource)
$album = t('on').' '.$c->tunesource;
$html .= $artist.$title.' '.$album;
}
// Last seen

2
system/Widget/widgets/Feed/Feed.php

@ -184,7 +184,7 @@ class Feed extends WidgetCommon {
<div class="posthead">
<a
class="button tiny icon feed merged left"
class="button tiny icon blog merged left"
href="?q=blog&f=<?php echo $this->user->getLogin(); ?>"
target="_blank">
<?php echo t('Blog'); ?>

2
system/Widget/widgets/ProfileData/ProfileData.php

@ -97,7 +97,7 @@ class ProfileData extends WidgetBase
<div id="mapdiv" style="width: auto; height: 250px; display: none;"></div>
<div class="clear"></div>
<a
class="button tiny icon add"
class="button tiny icon refresh"
onclick="getMyPosition(); this.style.display = \'none\';">'.
t('Update my position').'
</a>

3
system/Widget/widgets/Roster/Roster.php

@ -112,7 +112,8 @@ class Roster extends WidgetBase
if($type == 'bot')
$html .= '<div class="infoicon bot"></div>';
if(isset($contact->tuneartist) && $contact->tuneartist != '')
if((isset($contact->tuneartist) && $contact->tuneartist != '') ||
(isset($contact->tunetitle) && $contact->tunetitle != ''))
$html .= '<div class="infoicon tune"></div>';
$html .= '<a

BIN
system/js/images/bold.png

Before

Width: 16  |  Height: 16  |  Size: 304 B

BIN
system/js/images/center.png

Before

Width: 16  |  Height: 16  |  Size: 234 B

BIN
system/js/images/h1.png

Before

Width: 16  |  Height: 16  |  Size: 276 B

BIN
system/js/images/h2.png

Before

Width: 16  |  Height: 16  |  Size: 304 B

BIN
system/js/images/h3.png

Before

Width: 16  |  Height: 16  |  Size: 306 B

BIN
system/js/images/h4.png

Before

Width: 16  |  Height: 16  |  Size: 293 B

BIN
system/js/images/help.gif

Before

Width: 20  |  Height: 20  |  Size: 288 B

BIN
system/js/images/indent.png

Before

Width: 16  |  Height: 16  |  Size: 353 B

BIN
system/js/images/italic.png

Before

Width: 16  |  Height: 16  |  Size: 223 B

BIN
system/js/images/left.png

Before

Width: 16  |  Height: 16  |  Size: 209 B

BIN
system/js/images/link.png

Before

Width: 16  |  Height: 16  |  Size: 343 B

BIN
system/js/images/ol.png

Before

Width: 16  |  Height: 16  |  Size: 357 B

BIN
system/js/images/outdent.png

Before

Width: 16  |  Height: 16  |  Size: 351 B

BIN
system/js/images/paragraph.png

Before

Width: 16  |  Height: 16  |  Size: 236 B

BIN
system/js/images/picture.png

Before

Width: 16  |  Height: 16  |  Size: 606 B

BIN
system/js/images/right.png

Before

Width: 16  |  Height: 16  |  Size: 209 B

BIN
system/js/images/ul.png

Before

Width: 16  |  Height: 16  |  Size: 344 B

BIN
system/js/images/underline.png

Before

Width: 16  |  Height: 16  |  Size: 273 B

30
system/js/movim.js

@ -134,13 +134,13 @@ function getFeedMessage() {
return encodeURIComponent(message);
}
function frameHeight(n) {
if(n.className == 'button tiny icon add merged left') {
n.className = 'button tiny icon rm merged left';
document.querySelector('iframe#feedmessagecontent-frame').style.height = '400px';
function frameHeight(n, text) {
if(n.className == 'button tiny icon alone add merged left') {
n.className = 'button tiny icon alone rm merged left';
text.style.minHeight = '20em';
} else {
n.className = 'button tiny icon add merged left';
document.querySelector('iframe#feedmessagecontent-frame').style.height = '50px';
n.className = 'button tiny icon alone add merged left';
text.style.minHeight = '1.5em';
}
}
@ -154,3 +154,21 @@ function richText(n) {
}
}
/**
* Geolocalisation function
*/
function setPosition(node) {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(
function (position) {
var poss = position.coords.latitude +','+position.coords.longitude;
node.value = poss;
showPosition(poss);
},
// next function is the error callback
function (error) { }
);
}
}

207
system/js/steditor.js

@ -1,207 +0,0 @@
// +----------------------------------------------------------------+
// | SimpleTextEditor 1.0 |
// | Author: Cezary Tomczak [www.gosu.pl] |
// | Free for any use as long as all copyright messages are intact. |
// +----------------------------------------------------------------+
function SimpleTextEditor(id, objectId) {
if (!id || !objectId) { alert("SimpleTextEditor.constructor(id, objectId) failed, two arguments are required"); }
var self = this;
this.id = id;
this.objectId = objectId;
this.frame;
this.viewSource = false;
this.path = "system/js/"; // with slash at the end
this.cssFile = "";
this.charset = "iso-8859-1";
this.editorHtml = "";
this.frameHtml = "";
this.textareaValue = "";
this.browser = {
"ie": Boolean(document.body.currentStyle),
"gecko" : (navigator.userAgent.toLowerCase().indexOf("gecko") != -1)
};
this.init = function() {
if (document.getElementById && document.createElement && document.designMode && (this.browser.ie || this.browser.gecko)) {
// EDITOR
if (!document.getElementById(this.id)) { alert("SimpleTextEditor "+this.objectId+".init() failed, element '"+this.id+"' does not exist"); return; }
this.textareaValue = document.getElementById(this.id).value;
var ste = document.createElement("div");
document.getElementById(this.id).parentNode.replaceChild(ste, document.getElementById(this.id));
ste.id = this.id+"-ste";
ste.innerHTML = this.editorHtml ? this.editorHtml : this.getEditorHtml();
// BUTTONS
var buttons = ste.getElementsByTagName("td");
for (var i = 0; i < buttons.length; ++i) {
if (buttons[i].className == "button") {
buttons[i].id = this.id+'-button-'+i;
//buttons[i].onmouseover = function() { this.className = "button"; }
buttons[i].onmouseout = function() { this.className = this.className.replace(/button-hover(\s)?/, "button"); }
buttons[i].onclick = function(id) { return function() { this.className = "button-hover button-click"; setTimeout(function(){ document.getElementById(id).className = document.getElementById(id).className.replace(/(\s)?button-click/, ""); }, 100); } }(buttons[i].id);
}
}
// FRAME
if (this.browser.ie) {
this.frame = frames[this.id+"-frame"];
} else if (this.browser.gecko) {
this.frame = document.getElementById(this.id+"-frame").contentWindow;
}
this.frame.document.designMode = "on";
this.frame.document.open();
this.frame.document.write(this.frameHtml ? this.frameHtml : this.getFrameHtml());
this.frame.document.close();
insertHtmlFromTextarea();
}
};
function lockUrls(s) {
if (self.browser.gecko) { return s; }
return s.replace(/href=["']([^"']*)["']/g, 'href="simpletexteditor://simpletexteditor/$1"');
}
function unlockUrls(s) {
if (self.browser.gecko) { return s; }
return s.replace(/href=["']simpletexteditor:\/\/simpletexteditor\/([^"']*)["']/g, 'href="$1"');
}
function insertHtmlFromTextarea() {
try { self.frame.document.body.innerHTML = lockUrls(self.textareaValue); } catch (e) { setTimeout(insertHtmlFromTextarea, 10); }
}
this.getEditorHtml = function() {
var html = "";
html += '<input type="hidden" id="'+this.id+'" name="'+this.id+'" value="" autofocus="autofocus">';
html += '<table class="ste" cellspacing="0" cellpadding="0">';
html += '<div class="menueditor">';
html += '<a class="button tiny merged left" onclick="'+this.objectId+'.execCommand(\'formatblock\', \'<h1>\');"><img src="'+this.path+'images/h1.png" alt="H1" title="H1" ></a>';
html += '<a class="button tiny merged" onclick="'+this.objectId+'.execCommand(\'formatblock\', \'<h2>\');"><img src="'+this.path+'images/h2.png" alt="H2" title="H2" ></a>';
html += '<a class="button tiny merged" onclick="'+this.objectId+'.execCommand(\'formatblock\', \'<h3>\');"><img src="'+this.path+'images/h3.png" alt="H3" title="H3" ></a>';
html += '<a class="button tiny merged right" onclick="'+this.objectId+'.execCommand(\'formatblock\', \'<h4>\');"><img src="'+this.path+'images/h4.png" alt="H4" title="H4" ></a>';
html += '<a class="button tiny" style="margin-right: 5px;" onclick="'+this.objectId+'.execCommand(\'formatblock\', \'<p>\');"><img src="'+this.path+'images/paragraph.png" alt="Paragraph" title="Paragraph" ></a>';
html += '<a class="button tiny merged left" onclick="'+this.objectId+'.execCommand(\'bold\')"><img src="'+this.path+'images/bold.png" alt="Bold" title="Bold"></a>';
html += '<a class="button tiny merged" onclick="'+this.objectId+'.execCommand(\'italic\')"><img src="'+this.path+'images/italic.png" alt="Italic" title="Italic"></a>';
html += '<a class="button tiny merged right" onclick="'+this.objectId+'.execCommand(\'underline\')"><img src="'+this.path+'images/underline.png" alt="Underline" title="Underline"></a>';
html += '<a class="button tiny merged left" onclick="'+this.objectId+'.execCommand(\'justifyleft\')"><img src="'+this.path+'images/left.png" alt="Align Left" title="Align Left"></a>';
html += '<a class="button tiny merged" onclick="'+this.objectId+'.execCommand(\'justifycenter\')"><img src="'+this.path+'images/center.png" alt="Center" title="Center"></a>';
html += '<a class="button tiny merged right" onclick="'+this.objectId+'.execCommand(\'justifyright\')"><img src="'+this.path+'images/right.png" alt="Align Right" title="Align Right"></a>';
html += '<a class="button tiny merged left" onclick="'+this.objectId+'.execCommand(\'insertorderedlist\')"><img src="'+this.path+'images/ol.png" alt="Ordered List" title="Ordered List"></a>';
html += '<a class="button tiny merged right" onclick="'+this.objectId+'.execCommand(\'insertunorderedlist\')"><img src="'+this.path+'images/ul.png" alt="Unordered List" title="Unordered List"></a>';
html += '<br /><a class="button tiny merged left" onclick="'+this.objectId+'.execCommand(\'outdent\')"><img src="'+this.path+'images/outdent.png" alt="Outdent" title="Outdent"></a>';
html += '<a class="button tiny merged right" onclick="'+this.objectId+'.execCommand(\'indent\')"><img src="'+this.path+'images/indent.png" alt="Indent" title="Indent"></a>';
html += '<a class="button tiny merged left" onclick="'+this.objectId+'.execCommand(\'createlink\')"><img src="'+this.path+'images/link.png" alt="Insert Link" title="Insert Link"></a>';
html += '<a class="button tiny merged right" onclick="'+this.objectId+'.execCommand(\'insertimage\')"><img src="'+this.path+'images/picture.png" alt="Insert Image" title="Insert Image"></a>';
html += '</div>';
html += '<tr><td class="frame"><iframe style="height: 50px;" id="'+this.id+'-frame" frameborder="0"></iframe></td></tr>';
html += '</table>';
return html;
};
this.getFrameHtml = function() {
var html = "";
html += '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
html += '<html><head>';
html += '<meta http-equiv="Content-Type" content="text/html; charset='+this.charset+'">';
html += '<title>SimpleTextEditor frame</title>';
html += '<style type="text/css">html,body { cursor: text; } body { margin: 0px; padding: 0; font-size: 12px; }</style>';
html += '</head><body></body></html>';
return html;
};
this.openWindow = function(url, width, height) {
var x = (screen.width/2-width/2);
var y = (screen.height/2-height/2);
window.open(url, "", "scrollbars=yes,width="+width+",height="+height+",screenX="+(x)+",screenY="+y+",left="+x+",top="+y);
};
this.toggleSource = function() {
var html, text;
if (this.browser.ie) {
if (!this.viewSource) {
html = this.frame.document.body.innerHTML;
this.frame.document.body.innerText = unlockUrls(html);
document.getElementById(this.id+"-buttons").style.visibility = "hidden";
this.viewSource = true;
} else {
text = this.frame.document.body.innerText;
this.frame.document.body.innerHTML = lockUrls(text);
document.getElementById(this.id+"-buttons").style.visibility = "visible";
this.viewSource = false;
}
} else if (this.browser.gecko) {
if (!this.viewSource) {
html = document.createTextNode(this.frame.document.body.innerHTML);
this.frame.document.body.innerHTML = "";
this.frame.document.body.appendChild(html);
document.getElementById(this.id+"-buttons").style.visibility = "hidden";
this.viewSource = true;
} else {
html = this.frame.document.body.ownerDocument.createRange();
html.selectNodeContents(this.frame.document.body);
this.frame.document.body.innerHTML = html.toString();
document.getElementById(this.id+"-buttons").style.visibility = "visible";
this.viewSource = false;
}
}
document.getElementById(this.id+"-viewSource").checked = this.viewSource ? "checked" : "";
document.getElementById(this.id+"-viewSource").blur();
};
this.execCommand = function(cmd, value) {
if (cmd == "createlink" && !value) {
var url = prompt("Enter URL:", "");
if (url) {
this.frame.focus();
this.frame.document.execCommand("unlink", false, null);
if (this.browser.ie) this.frame.document.execCommand(cmd, false, "simpletexteditor://simpletexteditor/"+url);
else if (this.browser.gecko) this.frame.document.execCommand(cmd, false, url);
this.frame.focus();
}
} else if (cmd == "insertimage" && !value) {
var imageUrl = prompt("Enter Image URL:", "");
if (imageUrl) {
this.frame.focus();
this.frame.document.execCommand(cmd, false, imageUrl);
this.frame.focus();
}
} else {
this.frame.focus();
this.frame.document.execCommand(cmd, false, value);
this.frame.focus();
}
};
this.isOn = function() {
return Boolean(this.frame);
};
this.getContent = function() {
try { return unlockUrls(this.frame.document.body.innerHTML); } catch(e) { alert("SimpleTextEditor "+this.objectId+".getContent() failed"); }
};
this.submit = function() {
if (this.isOn()) {
if (this.viewSource) { this.toggleSource(); }
document.getElementById(this.id).value = this.getContent();
}
};
this.clearContent = function() {
this.frame.document.body.innerHTML = '';
};
}

49
themes/movim/css/forms.css

@ -34,6 +34,8 @@ legend {
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
overflow-y: hidden;
}
.element.large {
@ -306,6 +308,7 @@ form .element input:invalid {
padding-left: 2.5em;
position: relative;
overflow: hidden;
max-width: 100%;
}
/* Button loading */
@ -329,7 +332,7 @@ form .element input:invalid {
}
.button.icon:before {
content: "";
content: "";
font: 1em sans-serif;
font-weight: bold;
color: #444;
@ -346,19 +349,24 @@ form .element input:invalid {
/* Button tiny */
.button.tiny {
white-space: nowrap;
line-height: 2.4em;
height: 2.4em;
font-size: 0.8em;
line-height: 2em;
padding-left: 1em;
height: 2em;
font-size: 0.9em;
overflow: hidden;
text-overflow: ellipsis;
}
.button.tiny.icon {
padding-left: 2em;
padding-left: 2.5em;
}
.button.tiny.icon.alone {
padding-left: 1em;
}
.button.tiny.icon:before {
line-height: 2.4em;
line-height: 1.9em;
}
/* Button merged */
@ -383,19 +391,24 @@ form .element input:invalid {
border-color: #444;
}
.icon.yes:before { content: "✔"; }
.icon.no:before { content: "✘"; }
.icon.bubble { background-image: url(../img/icons/comments_icon.png); }
.icon.bubbleadd { background-image: url(../img/icons/comments_add.png); }
.icon.bubbleold { background-image: url(../img/icons/comments_show.png); }
.icon.yes:before { background-image: url(../img/icons/button/checkmark.png); }
.icon.no:before { background-image: url(../img/icons/button/close.png); }
.icon.bubble { background-image: url(../img/icons/comments_icon.png); }
.icon.bubbleadd { background-image: url(../img/icons/comments_add.png); }
.icon.bubbleold { background-image: url(../img/icons/comments_show.png); }
.icon.follow:before { content:"⇒" }
.icon.chat:before { background-image: url(../img/icons/chat_icon.png); content:"";}
.icon.add:before { content: "+"; }
.icon.rm:before { content:"—"; }
.icon.chat:before { background-image: url(../img/icons/chat_icon.png); content:"";}
.icon.add:before { content: "+"; }
.icon.rm:before { content: "–"; }
.icon.write:before { background-image: url(../img/icons/button/pencil.png); }
.icon.help:before { background-image: url(../img/icons/button/support.png); }
.icon.submit:before { content: "▼"; }
.icon.upload:before { content: "▲"; }
.icon.next:before { content: "→"; }
.icon.feed:before { content: "≡"; }
.icon.back:before { content: "←"; }
.icon.next:before { content: "→"; }
.icon.next:before { content: "→"; }
.icon.refresh:before{ background-image: url(../img/icons/button/loop.png); }
.icon.blog:before { background-image: url(../img/icons/button/quill.png); }
.icon.feed:before { background-image: url(../img/icons/button/feed.png); }
.icon.back:before { background-image: url(../img/icons/button/arrow-left.png); }
.icon.next:before { background-image: url(../img/icons/button/arrow-right.png); }
.icon.geo:before { background-image: url(../img/icons/button/location.png); }
.tiny.icon.loading:before { padding: 4px 7px; }

38
themes/movim/css/style2.css

@ -181,6 +181,14 @@ p {
line-height: 1.3em;
}
pre {
padding: 1em 0em;
}
code {
font-family: monospace;
}
/* For the simple xHTML lists */
ul.clean {
margin-left: 1.5em;
@ -726,18 +734,36 @@ dl dd {
/* Popup */
.popup {
background-color: rgba(0, 0, 0, 0.9);
position: fixed;
top: 10%;
left: 25%;
z-index: 10;
width: 50%;
max-height: 80%;
overflow-y: auto;
display: none;
background-color: rgba(0, 0, 0, 0.9);
padding: 2em;
border-radius: 3px;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
}
.popup:after {
position: fixed;
display: block;
z-index: 4;
top: 0px;
left: 0px;
z-index: 5;
width: 50%;
height: 80%;
padding: 10% 25%;
content: "";
width: 100%;
height: 100%;
pointer-events: none;
}
.popup span {
.popup span, .popup p, .popup pre, .popup h2, .popup h3, .popup a {
color: white;
}

28
themes/movim/css/submitform.css

@ -47,7 +47,17 @@ table#feedsubmitform {
#feedsubmitform .ste {
width: 100%;
margin: 0px;
padding: 0px;
padding: 0.2em;
}
#feedsubmitform span#postpublishlocation {
line-height: 1.8em;
height: 1.5em;
display: block;
white-space: nowrap;
width: 55%;
overflow: hidden;
text-overflow: ellipsis;
}
#feedsubmitform .button.merged.right {
@ -62,19 +72,3 @@ table#feedsubmitform {
margin-left: 1em;
height: auto;
}
#feedsubmitform .menueditor .button.tiny {
line-height: 1.7em;
}
#feedsubmitform td.frame {
padding: 0px;
}
#feedsubmitform .menueditor {
display: none;
}
iframe {
width: 100%;
}

BIN
themes/movim/img/icons/button/arrow-left.png

After

Width: 12  |  Height: 12  |  Size: 127 B

BIN
themes/movim/img/icons/button/arrow-right.png

After

Width: 12  |  Height: 12  |  Size: 127 B

BIN
themes/movim/img/icons/button/chat.png

After

Width: 12  |  Height: 12  |  Size: 231 B

BIN
themes/movim/img/icons/button/checkmark.png

After

Width: 12  |  Height: 12  |  Size: 157 B

BIN
themes/movim/img/icons/button/close.png

After

Width: 12  |  Height: 12  |  Size: 161 B

BIN
themes/movim/img/icons/button/comment.png

After

Width: 12  |  Height: 12  |  Size: 179 B

BIN
themes/movim/img/icons/button/envelope.png

After

Width: 12  |  Height: 12  |  Size: 219 B

BIN
themes/movim/img/icons/button/feed.png

After

Width: 12  |  Height: 12  |  Size: 326 B

BIN
themes/movim/img/icons/button/image.png

After

Width: 12  |  Height: 12  |  Size: 221 B

BIN
themes/movim/img/icons/button/link.png

After

Width: 12  |  Height: 12  |  Size: 281 B

BIN
themes/movim/img/icons/button/location.png

After

Width: 12  |  Height: 12  |  Size: 252 B

BIN
themes/movim/img/icons/button/loop.png

After

Width: 12  |  Height: 12  |  Size: 285 B

BIN
themes/movim/img/icons/button/minus.png

After

Width: 12  |  Height: 12  |  Size: 105 B

BIN
themes/movim/img/icons/button/pencil.png

After

Width: 12  |  Height: 12  |  Size: 260 B

BIN
themes/movim/img/icons/button/plus.png

After

Width: 12  |  Height: 12  |  Size: 148 B

BIN
themes/movim/img/icons/button/quill.png

After

Width: 12  |  Height: 12  |  Size: 270 B

BIN
themes/movim/img/icons/button/remove.png

After

Width: 12  |  Height: 12  |  Size: 216 B

BIN
themes/movim/img/icons/button/support.png

After

Width: 12  |  Height: 12  |  Size: 248 B

BIN
themes/movim/img/icons/button/upload.png

After

Width: 12  |  Height: 12  |  Size: 183 B

1
themes/movim/page.tpl

@ -10,7 +10,6 @@
<link rel="shortcut icon" href="<?php $this->link_file('img/favicon.ico');?>" />
<link rel="stylesheet" href="system/js/leaflet.css" />
<script src="system/js/leaflet.js"></script>
<script src="system/js/steditor.js"></script>
<?php
$this->addCss('css/animations.css');
$this->addCss('css/forms.css');

Loading…
Cancel
Save