hallo_rails 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/hallo_rails/version.rb +1 -1
- data/vendor/assets/javascripts/hallo.js +73 -26
- metadata +3 -3
data/lib/hallo_rails/version.rb
CHANGED
@@ -780,30 +780,41 @@
|
|
780
780
|
editable: null,
|
781
781
|
toolbar: null,
|
782
782
|
uuid: "",
|
783
|
+
lang: 'en',
|
783
784
|
dialogOpts: {
|
784
785
|
autoOpen: false,
|
785
786
|
width: 600,
|
786
787
|
height: 'auto',
|
787
|
-
title: "Edit HTML",
|
788
788
|
modal: false,
|
789
789
|
resizable: true,
|
790
790
|
draggable: true,
|
791
791
|
dialogClass: 'htmledit-dialog'
|
792
792
|
},
|
793
793
|
dialog: null,
|
794
|
-
buttonCssClass: null
|
795
|
-
button_label: 'Edit HTML'
|
794
|
+
buttonCssClass: null
|
796
795
|
},
|
796
|
+
translations: {
|
797
|
+
en: {
|
798
|
+
title: 'Edit HTML',
|
799
|
+
update: 'Update'
|
800
|
+
},
|
801
|
+
de: {
|
802
|
+
title: 'HTML bearbeiten',
|
803
|
+
update: 'Aktualisieren'
|
804
|
+
}
|
805
|
+
},
|
806
|
+
texts: null,
|
797
807
|
populateToolbar: function($toolbar) {
|
798
808
|
var $buttonHolder, $buttonset, id, widget;
|
799
809
|
widget = this;
|
810
|
+
this.texts = this.translations[this.options.lang];
|
800
811
|
this.options.toolbar = $toolbar;
|
801
812
|
this.options.dialog = $("<div>").attr('id', "" + this.options.uuid + "-htmledit-dialog");
|
802
813
|
$buttonset = $("<span>").addClass(widget.widgetName);
|
803
814
|
id = "" + this.options.uuid + "-htmledit";
|
804
815
|
$buttonHolder = $('<span>');
|
805
816
|
$buttonHolder.hallobutton({
|
806
|
-
label: this.
|
817
|
+
label: this.texts.title,
|
807
818
|
icon: 'icon-list-alt',
|
808
819
|
editable: this.options.editable,
|
809
820
|
command: null,
|
@@ -825,7 +836,8 @@
|
|
825
836
|
return widget._closeDialog();
|
826
837
|
});
|
827
838
|
$toolbar.append($buttonset);
|
828
|
-
|
839
|
+
this.options.dialog.dialog(this.options.dialogOpts);
|
840
|
+
return this.options.dialog.dialog("option", "title", this.texts.title);
|
829
841
|
},
|
830
842
|
_openDialog: function() {
|
831
843
|
var $editableEl, html, widget, xposition, yposition,
|
@@ -845,7 +857,7 @@
|
|
845
857
|
this.options.dialog.html($("<textarea>").addClass('html_source'));
|
846
858
|
html = this.options.editable.element.html();
|
847
859
|
this.options.dialog.children('.html_source').val(html);
|
848
|
-
this.options.dialog.prepend($(
|
860
|
+
this.options.dialog.prepend($("<button>" + this.texts.update + "</button>"));
|
849
861
|
return this.options.dialog.on('click', 'button', function() {
|
850
862
|
widget.options.editable.element.html(widget.options.dialog.children('.html_source').val());
|
851
863
|
widget.options.editable.element.trigger('change');
|
@@ -1731,6 +1743,7 @@
|
|
1731
1743
|
toolbar: null,
|
1732
1744
|
uuid: "",
|
1733
1745
|
insert_file_dialog_ui_url: null,
|
1746
|
+
lang: 'en',
|
1734
1747
|
dialogOpts: {
|
1735
1748
|
autoOpen: false,
|
1736
1749
|
width: 560,
|
@@ -1741,14 +1754,47 @@
|
|
1741
1754
|
dialogClass: 'insert-image-dialog'
|
1742
1755
|
},
|
1743
1756
|
dialog: null,
|
1744
|
-
buttonCssClass: null
|
1745
|
-
|
1757
|
+
buttonCssClass: null
|
1758
|
+
},
|
1759
|
+
translations: {
|
1760
|
+
en: {
|
1761
|
+
title_insert: 'Insert Image',
|
1762
|
+
title_properties: 'Image Properties',
|
1763
|
+
insert: 'Insert',
|
1764
|
+
chage_image: 'Change Image:',
|
1765
|
+
source: 'URL',
|
1766
|
+
width: 'Width',
|
1767
|
+
height: 'Height',
|
1768
|
+
alt: 'Alt Text',
|
1769
|
+
padding: 'Padding',
|
1770
|
+
float: 'Float',
|
1771
|
+
float_left: 'left',
|
1772
|
+
float_right: 'right',
|
1773
|
+
float_none: 'No'
|
1774
|
+
},
|
1775
|
+
de: {
|
1776
|
+
title_insert: 'Bild einfügen',
|
1777
|
+
title_properties: 'Bild Eigenschaften',
|
1778
|
+
insert: 'Einfügen',
|
1779
|
+
chage_image: 'Bild ändern:',
|
1780
|
+
source: 'URL',
|
1781
|
+
width: 'Breite',
|
1782
|
+
height: 'Höhe',
|
1783
|
+
alt: 'Alt Text',
|
1784
|
+
padding: 'Padding',
|
1785
|
+
float: 'Float',
|
1786
|
+
float_left: 'Links',
|
1787
|
+
float_right: 'Rechts',
|
1788
|
+
float_none: 'Nein'
|
1789
|
+
}
|
1746
1790
|
},
|
1791
|
+
texts: null,
|
1747
1792
|
dialog_image_selection_ui_loaded: false,
|
1748
1793
|
$image: null,
|
1749
1794
|
populateToolbar: function($toolbar) {
|
1750
1795
|
var $buttonHolder, $buttonset, dialog_html, widget;
|
1751
1796
|
widget = this;
|
1797
|
+
this.texts = this.translations[this.options.lang];
|
1752
1798
|
this.options.toolbar = $toolbar;
|
1753
1799
|
dialog_html = "<div id='hallo_img_properties'></div>";
|
1754
1800
|
if (this.options.insert_file_dialog_ui_url) {
|
@@ -1758,7 +1804,7 @@
|
|
1758
1804
|
$buttonset = $("<span>").addClass(this.widgetName);
|
1759
1805
|
$buttonHolder = $('<span>');
|
1760
1806
|
$buttonHolder.hallobutton({
|
1761
|
-
label: this.
|
1807
|
+
label: this.texts.title_insert,
|
1762
1808
|
icon: 'icon-picture',
|
1763
1809
|
editable: this.options.editable,
|
1764
1810
|
command: null,
|
@@ -1814,7 +1860,7 @@
|
|
1814
1860
|
this.options.editable.keepActivated(true);
|
1815
1861
|
this.options.dialog.dialog("open");
|
1816
1862
|
if (this.$image) {
|
1817
|
-
this.options.dialog.dialog("option", "title",
|
1863
|
+
this.options.dialog.dialog("option", "title", this.texts.title_properties);
|
1818
1864
|
$(document).keyup(function(e) {
|
1819
1865
|
if (e.keyCode === 46 || e.keyCode === 8) {
|
1820
1866
|
$(document).off();
|
@@ -1830,7 +1876,7 @@
|
|
1830
1876
|
});
|
1831
1877
|
} else {
|
1832
1878
|
this.options.dialog.children('#hallo_img_properties').hide();
|
1833
|
-
this.options.dialog.dialog("option", "title",
|
1879
|
+
this.options.dialog.dialog("option", "title", this.texts.title_insert);
|
1834
1880
|
if ($('#hallo_img_file_select_title').length > 0) {
|
1835
1881
|
$('#hallo_img_file_select_title').text('');
|
1836
1882
|
}
|
@@ -1880,7 +1926,7 @@
|
|
1880
1926
|
url: this.options.insert_file_dialog_ui_url,
|
1881
1927
|
success: function(data, textStatus, jqXHR) {
|
1882
1928
|
var file_select_title;
|
1883
|
-
file_select_title = widget.options.dialog.children('#hallo_img_properties').is(':visible') ?
|
1929
|
+
file_select_title = widget.options.dialog.children('#hallo_img_properties').is(':visible') ? widget.texts.change_image : '';
|
1884
1930
|
widget.options.dialog.children('#hallo_img_file_select_ui').html(("<div id='hallo_img_file_select_title'>" + file_select_title + "</div>") + data);
|
1885
1931
|
return widget.dialog_image_selection_ui_loaded = true;
|
1886
1932
|
},
|
@@ -1895,33 +1941,33 @@
|
|
1895
1941
|
$img_properties = this.options.dialog.children('#hallo_img_properties');
|
1896
1942
|
if (this.$image) {
|
1897
1943
|
html = this._property_input_html('source', this.$image.attr('src'), {
|
1898
|
-
label:
|
1899
|
-
}) + this._property_input_html('alt', this.$image.attr('alt'), {
|
1900
|
-
label:
|
1944
|
+
label: this.texts.source
|
1945
|
+
}) + this._property_input_html('alt', this.$image.attr('alt') || '', {
|
1946
|
+
label: this.texts.alt
|
1901
1947
|
}) + this._property_row_html(this._property_input_html('width', (this.$image.is('[width]') ? this.$image.attr('width') : ''), {
|
1902
|
-
label:
|
1948
|
+
label: this.texts.width,
|
1903
1949
|
row: false
|
1904
1950
|
}) + this._property_input_html('height', (this.$image.is('[height]') ? this.$image.attr('height') : ''), {
|
1905
|
-
label:
|
1951
|
+
label: this.texts.height,
|
1906
1952
|
row: false
|
1907
1953
|
})) + this._property_input_html('padding', this.$image.css('padding'), {
|
1908
|
-
label:
|
1954
|
+
label: this.texts.padding
|
1909
1955
|
}) + this._property_row_html(this._property_cb_html('float_left', this.$image.css('float') === 'left', {
|
1910
|
-
label:
|
1956
|
+
label: this.texts.float_left,
|
1911
1957
|
row: false
|
1912
1958
|
}) + this._property_cb_html('float_right', this.$image.css('float') === 'right', {
|
1913
|
-
label:
|
1959
|
+
label: this.texts.float_right,
|
1914
1960
|
row: false
|
1915
1961
|
}) + this._property_cb_html('unfloat', this.$image.css('float') === 'none', {
|
1916
|
-
label:
|
1962
|
+
label: this.texts.float_none,
|
1917
1963
|
row: false
|
1918
|
-
}),
|
1964
|
+
}), this.texts.float);
|
1919
1965
|
$img_properties.html(html);
|
1920
1966
|
$img_properties.show();
|
1921
1967
|
} else {
|
1922
1968
|
if (!this.options.insert_file_dialog_ui_url) {
|
1923
1969
|
$img_properties.html(this._property_input_html('source', '', {
|
1924
|
-
label:
|
1970
|
+
label: this.texts.source
|
1925
1971
|
}));
|
1926
1972
|
$img_properties.show();
|
1927
1973
|
}
|
@@ -1931,7 +1977,7 @@
|
|
1931
1977
|
$('#insert_image_btn').remove();
|
1932
1978
|
}
|
1933
1979
|
if ($('#hallo_img_file_select_title').length > 0) {
|
1934
|
-
$('#hallo_img_file_select_title').text(
|
1980
|
+
$('#hallo_img_file_select_title').text(this.texts.chage_image);
|
1935
1981
|
}
|
1936
1982
|
$('#hallo_img_properties #hallo_img_source').keyup(function() {
|
1937
1983
|
return widget.$image.attr('src', this.value);
|
@@ -1976,7 +2022,7 @@
|
|
1976
2022
|
});
|
1977
2023
|
} else {
|
1978
2024
|
if (!this.options.insert_file_dialog_ui_url) {
|
1979
|
-
$img_properties.after(
|
2025
|
+
$img_properties.after("<button id=\"insert_image_btn\">" + this.texts.insert + "</button>");
|
1980
2026
|
return $('#insert_image_btn').click(function() {
|
1981
2027
|
return widget._insert_image($('#hallo_img_properties #hallo_img_source').val());
|
1982
2028
|
});
|
@@ -2124,6 +2170,7 @@
|
|
2124
2170
|
width: 540,
|
2125
2171
|
height: 95,
|
2126
2172
|
title: "Enter Link",
|
2173
|
+
buttonTitle: "Insert",
|
2127
2174
|
modal: true,
|
2128
2175
|
resizable: false,
|
2129
2176
|
draggable: false,
|
@@ -2136,7 +2183,7 @@
|
|
2136
2183
|
_this = this;
|
2137
2184
|
widget = this;
|
2138
2185
|
dialogId = "" + this.options.uuid + "-dialog";
|
2139
|
-
dialog = jQuery("<div id=\"" + dialogId + "\"> <form action=\"#\" method=\"post\" class=\"linkForm\"> <input class=\"url\" type=\"text\" name=\"url\" value=\"" + this.options.defaultUrl + "\" /> <input type=\"submit\" id=\"addlinkButton\" value=\"
|
2186
|
+
dialog = jQuery("<div id=\"" + dialogId + "\"> <form action=\"#\" method=\"post\" class=\"linkForm\"> <input class=\"url\" type=\"text\" name=\"url\" value=\"" + this.options.defaultUrl + "\" /> <input type=\"submit\" id=\"addlinkButton\" value=\"" + this.options.dialogOpts.buttonTitle + "\" /> </form></div>");
|
2140
2187
|
urlInput = jQuery('input[name=url]', dialog).focus(function(e) {
|
2141
2188
|
return this.select();
|
2142
2189
|
});
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hallo_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -60,7 +60,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
60
60
|
version: '0'
|
61
61
|
segments:
|
62
62
|
- 0
|
63
|
-
hash:
|
63
|
+
hash: 3054115558163806407
|
64
64
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
65
|
none: false
|
66
66
|
requirements:
|
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
69
|
version: '0'
|
70
70
|
segments:
|
71
71
|
- 0
|
72
|
-
hash:
|
72
|
+
hash: 3054115558163806407
|
73
73
|
requirements: []
|
74
74
|
rubyforge_project:
|
75
75
|
rubygems_version: 1.8.24
|